From 13ee1845bacc5e059d9dc58c2deba8d22dc35b06 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 16 Jun 2023 18:52:05 +0200 Subject: [PATCH 01/91] upgrade to latest generated java model and adding toString method --- .../v3/dataformat/aasx/AASXDeserializer.java | 3 +- .../v3/dataformat/aasx/AASXSerializer.java | 3 +- ...ssetAdministrationShellElementVisitor.java | 9 +- ...ministrationShellElementWalkerVisitor.java | 25 +- .../core/serialization/EnumSerializer.java | 9 +- .../v3/dataformat/core/util/AasUtils.java | 5 +- .../aas4j/v3/dataformat/core/AASFull.java | 416 +++++++++--------- .../aas4j/v3/dataformat/core/AASSimple.java | 37 +- .../v3/dataformat/core/CustomProperty.java | 23 +- .../json/mixins/SubmodelElementListMixin.java | 13 +- .../v3/dataformat/json/util/Examples.java | 9 +- .../ValueReferencePairNodeDeserializer.java | 19 +- .../xml/mixins/AssetInformationMixin.java | 7 +- .../dataformat/xml/mixins/QualifierMixin.java | 5 +- .../dataformat/xml/mixins/ResourceMixin.java | 5 +- .../xml/mixins/SubmodelElementListMixin.java | 13 +- .../v3/dataformat/xml/XmlSerializerTest.java | 7 +- ...Elements.java => AasSubmodelElements.java} | 39 +- .../aas4j/v3/model/AbstractLangString.java | 3 +- .../v3/model/AdministrativeInformation.java | 55 +-- .../model/AnnotatedRelationshipElement.java | 1 + .../v3/model/AssetAdministrationShell.java | 37 +- .../aas4j/v3/model/AssetInformation.java | 81 ++-- .../digitaltwin/aas4j/v3/model/AssetKind.java | 1 + .../aas4j/v3/model/BasicEventElement.java | 119 ++--- .../digitaltwin/aas4j/v3/model/Blob.java | 37 +- .../aas4j/v3/model/Capability.java | 1 + .../aas4j/v3/model/ConceptDescription.java | 9 +- .../aas4j/v3/model/DataElement.java | 1 + .../v3/model/DataSpecificationContent.java | 1 + .../v3/model/DataSpecificationIec61360.java | 193 ++++---- .../aas4j/v3/model/DataTypeDefXSD.java | 178 -------- .../aas4j/v3/model/DataTypeIec61360.java | 41 +- .../digitaltwin/aas4j/v3/model/Direction.java | 1 + .../v3/model/EmbeddedDataSpecification.java | 1 + .../digitaltwin/aas4j/v3/model/Entity.java | 63 +-- .../aas4j/v3/model/EntityType.java | 1 + .../aas4j/v3/model/Environment.java | 37 +- .../aas4j/v3/model/EventElement.java | 1 + .../aas4j/v3/model/EventPayload.java | 131 +++--- .../digitaltwin/aas4j/v3/model/Extension.java | 37 +- .../digitaltwin/aas4j/v3/model/File.java | 37 +- .../aas4j/v3/model/HasDataSpecification.java | 3 +- .../aas4j/v3/model/HasExtensions.java | 1 + .../digitaltwin/aas4j/v3/model/HasKind.java | 1 + .../aas4j/v3/model/HasSemantics.java | 17 +- .../aas4j/v3/model/Identifiable.java | 1 + .../digitaltwin/aas4j/v3/model/Key.java | 1 + .../digitaltwin/aas4j/v3/model/KeyTypes.java | 1 + .../LangStringDefinitionTypeIec61360.java | 1 + .../aas4j/v3/model/LangStringNameType.java | 1 + .../LangStringPreferredNameTypeIec61360.java | 1 + .../LangStringShortNameTypeIec61360.java | 1 + .../aas4j/v3/model/LangStringTextType.java | 1 + .../digitaltwin/aas4j/v3/model/LevelType.java | 39 +- .../aas4j/v3/model/ModellingKind.java | 1 + .../aas4j/v3/model/MultiLanguageProperty.java | 23 +- .../digitaltwin/aas4j/v3/model/Operation.java | 39 +- .../aas4j/v3/model/OperationVariable.java | 1 + .../digitaltwin/aas4j/v3/model/Property.java | 53 +-- .../aas4j/v3/model/Qualifiable.java | 1 + .../digitaltwin/aas4j/v3/model/Qualifier.java | 53 +-- .../aas4j/v3/model/QualifierKind.java | 3 +- .../digitaltwin/aas4j/v3/model/Range.java | 37 +- .../digitaltwin/aas4j/v3/model/Referable.java | 53 +-- .../digitaltwin/aas4j/v3/model/Reference.java | 55 +-- .../aas4j/v3/model/ReferenceElement.java | 1 + .../aas4j/v3/model/ReferenceTypes.java | 1 + .../aas4j/v3/model/RelationshipElement.java | 1 + .../digitaltwin/aas4j/v3/model/Resource.java | 37 +- .../aas4j/v3/model/SpecificAssetID.java | 88 ---- .../aas4j/v3/model/StateOfEvent.java | 1 + .../digitaltwin/aas4j/v3/model/Submodel.java | 3 +- .../aas4j/v3/model/SubmodelElement.java | 7 +- .../v3/model/SubmodelElementCollection.java | 11 +- .../aas4j/v3/model/SubmodelElementList.java | 57 +-- .../digitaltwin/aas4j/v3/model/ValueList.java | 1 + .../aas4j/v3/model/ValueReferencePair.java | 19 +- .../aas4j/v3/model/annotations/IRI.java | 1 + .../v3/model/annotations/KnownSubtypes.java | 1 + .../v3/model/builder/AbstractBuilder.java | 1 + .../AdministrativeInformationBuilder.java | 31 +- .../AnnotatedRelationshipElementBuilder.java | 105 ++--- .../AssetAdministrationShellBuilder.java | 71 +-- .../builder/AssetInformationBuilder.java | 53 +-- .../builder/BasicEventElementBuilder.java | 167 +++---- .../aas4j/v3/model/builder/BlobBuilder.java | 125 +++--- .../aas4j/v3/model/builder/Builder.java | 1 + .../v3/model/builder/CapabilityBuilder.java | 105 ++--- .../builder/ConceptDescriptionBuilder.java | 67 +-- .../DataSpecificationIec61360Builder.java | 135 +++--- .../EmbeddedDataSpecificationBuilder.java | 1 + .../aas4j/v3/model/builder/EntityBuilder.java | 163 +++---- .../v3/model/builder/EnvironmentBuilder.java | 41 +- .../v3/model/builder/EventPayloadBuilder.java | 71 +-- .../v3/model/builder/ExtendableBuilder.java | 1 + .../v3/model/builder/ExtensionBuilder.java | 53 +-- .../aas4j/v3/model/builder/FileBuilder.java | 125 +++--- .../aas4j/v3/model/builder/KeyBuilder.java | 1 + ...ngStringDefinitionTypeIec61360Builder.java | 1 + .../builder/LangStringNameTypeBuilder.java | 1 + ...tringPreferredNameTypeIec61360Builder.java | 1 + ...angStringShortNameTypeIec61360Builder.java | 1 + .../builder/LangStringTextTypeBuilder.java | 1 + .../v3/model/builder/LevelTypeBuilder.java | 23 +- .../builder/MultiLanguagePropertyBuilder.java | 131 +++--- .../v3/model/builder/OperationBuilder.java | 149 +++---- .../builder/OperationVariableBuilder.java | 1 + .../v3/model/builder/PropertyBuilder.java | 135 +++--- .../v3/model/builder/QualifierBuilder.java | 43 +- .../aas4j/v3/model/builder/RangeBuilder.java | 125 +++--- .../v3/model/builder/ReferenceBuilder.java | 41 +- .../builder/ReferenceElementBuilder.java | 105 ++--- .../builder/RelationshipElementBuilder.java | 105 ++--- .../v3/model/builder/ResourceBuilder.java | 21 +- .../model/builder/SpecificAssetIDBuilder.java | 91 ---- .../v3/model/builder/SubmodelBuilder.java | 131 +++--- .../SubmodelElementCollectionBuilder.java | 122 ++--- .../builder/SubmodelElementListBuilder.java | 147 ++++--- .../v3/model/builder/ValueListBuilder.java | 1 + .../builder/ValueReferencePairBuilder.java | 11 +- .../DefaultAdministrativeInformation.java | 55 ++- .../DefaultAnnotatedRelationshipElement.java | 88 ++-- .../impl/DefaultAssetAdministrationShell.java | 88 ++-- .../model/impl/DefaultAssetInformation.java | 68 +-- .../model/impl/DefaultBasicEventElement.java | 172 ++++---- .../aas4j/v3/model/impl/DefaultBlob.java | 113 ++--- .../v3/model/impl/DefaultCapability.java | 87 ++-- .../model/impl/DefaultConceptDescription.java | 62 +-- .../DefaultDataSpecificationIec61360.java | 182 ++++---- .../DefaultEmbeddedDataSpecification.java | 13 +- .../aas4j/v3/model/impl/DefaultEntity.java | 141 +++--- .../v3/model/impl/DefaultEnvironment.java | 38 +- .../v3/model/impl/DefaultEventPayload.java | 116 ++--- .../aas4j/v3/model/impl/DefaultExtension.java | 61 +-- .../aas4j/v3/model/impl/DefaultFile.java | 113 ++--- .../aas4j/v3/model/impl/DefaultKey.java | 13 +- ...faultLangStringDefinitionTypeIec61360.java | 17 +- .../model/impl/DefaultLangStringNameType.java | 13 +- ...ltLangStringPreferredNameTypeIec61360.java | 17 +- ...efaultLangStringShortNameTypeIec61360.java | 17 +- .../model/impl/DefaultLangStringTextType.java | 13 +- .../aas4j/v3/model/impl/DefaultLevelType.java | 47 +- .../impl/DefaultMultiLanguageProperty.java | 119 ++--- .../aas4j/v3/model/impl/DefaultOperation.java | 118 ++--- .../model/impl/DefaultOperationVariable.java | 8 + .../aas4j/v3/model/impl/DefaultProperty.java | 132 +++--- .../aas4j/v3/model/impl/DefaultQualifier.java | 72 +-- .../aas4j/v3/model/impl/DefaultRange.java | 116 ++--- .../aas4j/v3/model/impl/DefaultReference.java | 54 ++- .../model/impl/DefaultReferenceElement.java | 88 ++-- .../impl/DefaultRelationshipElement.java | 89 ++-- .../aas4j/v3/model/impl/DefaultResource.java | 37 +- .../v3/model/impl/DefaultSpecificAssetID.java | 147 ------- .../aas4j/v3/model/impl/DefaultSubmodel.java | 120 ++--- .../DefaultSubmodelElementCollection.java | 103 ++--- .../impl/DefaultSubmodelElementList.java | 138 +++--- .../aas4j/v3/model/impl/DefaultValueList.java | 8 + .../model/impl/DefaultValueReferencePair.java | 29 +- 159 files changed, 3936 insertions(+), 4011 deletions(-) rename model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/{AASSubmodelElements.java => AasSubmodelElements.java} (59%) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index d2ce12523..5108b7bf9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,7 +169,7 @@ private List parseElements(Collection elements) { paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValue())); + paths.addAll(parseElements(collection.getValues())); } } return paths; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 095c964e2..449be54c3 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -225,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); } } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java index f9b13eceb..d0e27b8f7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +54,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; @@ -132,8 +133,8 @@ public default void visit(HasSemantics hasSemantics) { Class type = hasSemantics.getClass(); if (Extension.class.isAssignableFrom(type)) { visit((Extension) hasSemantics); - } else if (SpecificAssetID.class.isAssignableFrom(type)) { - visit((SpecificAssetID) hasSemantics); + } else if (SpecificAssetId.class.isAssignableFrom(type)) { + visit((SpecificAssetId) hasSemantics); } else if (Submodel.class.isAssignableFrom(type)) { visit((Submodel) hasSemantics); } else if (SubmodelElement.class.isAssignableFrom(type)) { @@ -245,7 +246,7 @@ public default void visit(Extension extension) { public default void visit(File file) { } - public default void visit(SpecificAssetID identifierKeyValuePair) { + public default void visit(SpecificAssetId identifierKeyValuePair) { } public default void visit(Key key) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index d16f45849..f8229333e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,7 +72,7 @@ public default void visit(ConceptDescription conceptDescription) { if (conceptDescription == null) { return; } - conceptDescription.getIsCaseOf().forEach(x -> visit(x)); + conceptDescription.getIsCaseOfs().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(conceptDescription); } @@ -98,7 +99,7 @@ public default void visit(HasSemantics hasSemantics) { if (hasSemantics == null) { return; } - visit(hasSemantics.getSemanticID()); + visit(hasSemantics.getSemanticId()); hasSemantics.getSupplementalSemanticIds().forEach(x->visit(x)); AssetAdministrationShellElementVisitor.super.visit(hasSemantics); } @@ -113,11 +114,11 @@ public default void visit(Identifiable identifiable) { } @Override - public default void visit(SpecificAssetID specificAssetId) { + public default void visit(SpecificAssetId specificAssetId) { if (specificAssetId == null) { return; } - visit(specificAssetId.getExternalSubjectID()); + visit(specificAssetId.getExternalSubjectId()); AssetAdministrationShellElementVisitor.super.visit(specificAssetId); } @@ -126,8 +127,8 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValue().forEach(x -> visit(x)); - visit(multiLanguageProperty.getValueID()); + multiLanguageProperty.getValues().forEach(x -> visit(x)); + visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -145,7 +146,7 @@ public default void visit(Property property) { if (property == null) { return; } - visit(property.getValueID()); + visit(property.getValueId()); AssetAdministrationShellElementVisitor.super.visit(property); } @@ -163,7 +164,7 @@ public default void visit(Qualifier qualifier) { if (qualifier == null) { return; } - visit(qualifier.getValueID()); + visit(qualifier.getValueId()); AssetAdministrationShellElementVisitor.super.visit(qualifier); } @@ -172,8 +173,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescription().forEach(x -> visit(x)); - referable.getDisplayName().forEach(x -> visit(x)); + referable.getDescriptions().forEach(x -> visit(x)); + referable.getDisplayNames().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -252,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - extension.getRefersTo().forEach(x -> visit(x)); + extension.getRefersTos().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } @@ -281,7 +282,7 @@ public default void visit(SubmodelElementCollection submodelElementCollection) { if (submodelElementCollection == null) { return; } - submodelElementCollection.getValue().forEach(x -> visit(x)); + submodelElementCollection.getValues().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index dadf9bc6c..bc015d93e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +19,7 @@ import java.io.IOException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -37,11 +38,11 @@ public class EnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { - if (value instanceof DataTypeDefXSD) { + if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation - if (value.equals(DataTypeDefXSD.ANY_URI)) { + if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); - } else if (value.equals(DataTypeDefXSD.NON_NEGATIVE_INTEGER)) { + } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { gen.writeString("xs:nonNegativeInteger"); } else if(isTimeRelatedValue(value)) { handleTimeRelatedValue(gen, value); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index a7d12cd1a..46985b03e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -331,14 +332,14 @@ public static T resolve(Reference reference, Environment e if (keyType != null) { if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - current = ((SubmodelElementList) current).getValue().get(Integer.parseInt(key.getValue())); + current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", i, key.getValue())); } catch (IndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", i, - ((SubmodelElementList) current).getValue().size(), + ((SubmodelElementList) current).getValues().size(), key.getValue())); } } else { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 4844d4e3c..483d4a0d9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +19,11 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; @@ -88,10 +89,9 @@ public class AASFull { public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - )) + .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) + .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + ) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() .version("0") @@ -106,7 +106,7 @@ public static AssetAdministrationShell createAAS1() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset") + .globalAssetId("https://acplt.org/Test_Asset") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -138,7 +138,7 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -163,7 +163,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -171,7 +171,7 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) @@ -182,7 +182,7 @@ public static AssetAdministrationShell createAAS4() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://acplt.org/Test_Asset_Missing") + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -197,7 +197,7 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) @@ -207,7 +207,7 @@ public static Submodel createSubmodel1() { .revision("9") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") @@ -219,11 +219,11 @@ public static Submodel createSubmodel1() { .displayName( new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() ) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("0173-1#02-AAO677#002") @@ -234,19 +234,19 @@ public static Submodel createSubmodel1() { .qualifiers(new DefaultQualifier.Builder() .value("100") .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .qualifiers(new DefaultQualifier.Builder() .value("50") .type("http://acplt.org/Qualifier/ExampleQualifier2") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/ValueId/ACPLT") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ACPLT") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -254,11 +254,11 @@ public static Submodel createSubmodel1() { .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") .category("VARIABLE") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -282,8 +282,8 @@ public static Submodel createSubmodel1() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build())) .value("978-8234-234-342") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") @@ -297,7 +297,7 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) @@ -306,7 +306,7 @@ public static Submodel createSubmodel2() { .version("0") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") @@ -315,11 +315,11 @@ public static Submodel createSubmodel2() { .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -329,23 +329,23 @@ public static Submodel createSubmodel2() { .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValue2") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExampleValue2") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -353,23 +353,23 @@ public static Submodel createSubmodel2() { .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueType(DataTypeDefXSD.STRING) - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueType(DataTypeDefXsd.STRING) + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -378,11 +378,11 @@ public static Submodel createSubmodel2() { .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") @@ -390,7 +390,7 @@ public static Submodel createSubmodel2() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetID("https://acplt.org/Test_Asset2") + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -398,7 +398,7 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -408,7 +408,7 @@ public static Submodel createSubmodel3() { .revision("9") .build()) .kind(ModellingKind.INSTANCE) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -418,11 +418,11 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -463,11 +463,11 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -508,17 +508,17 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -529,89 +529,89 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -624,11 +624,11 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -655,64 +655,64 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( + .values(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) - .valueID(new DefaultReference.Builder() + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") + .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) @@ -720,11 +720,11 @@ public static Submodel createSubmodel3() { .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -733,18 +733,18 @@ public static Submodel createSubmodel3() { .build()) .min("0") .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -754,11 +754,11 @@ public static Submodel createSubmodel3() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) @@ -770,11 +770,11 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -787,11 +787,11 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -918,11 +918,11 @@ public static Submodel createSubmodel4() { .submodelElements(new DefaultSubmodelElementList.Builder() .idShort("ExampleSubmodelElementListUnordered") .orderRelevant(false) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") @@ -931,9 +931,9 @@ public static Submodel createSubmodel4() { .idShort("ExampleRange") .min(null) .max(null) - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -967,7 +967,7 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -977,7 +977,7 @@ public static Submodel createSubmodel6() { .version("0") .revision("9") .build()) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -987,11 +987,11 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -1032,11 +1032,11 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -1077,17 +1077,17 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -1098,11 +1098,11 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1111,21 +1111,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1134,21 +1134,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1157,21 +1157,21 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -1184,11 +1184,11 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -1215,12 +1215,12 @@ public static Submodel createSubmodel6() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) - .description(Arrays.asList( + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") @@ -1230,11 +1230,11 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1243,26 +1243,26 @@ public static Submodel createSubmodel6() { .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value("exampleValue") - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( + .values(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) @@ -1270,11 +1270,11 @@ public static Submodel createSubmodel6() { .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1283,18 +1283,18 @@ public static Submodel createSubmodel6() { .build()) .min("0") .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1304,11 +1304,11 @@ public static Submodel createSubmodel6() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") @@ -1321,11 +1321,11 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -1338,11 +1338,11 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -1372,7 +1372,7 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) @@ -1382,7 +1382,7 @@ public static Submodel createSubmodel7() { .version("0") .revision("9") .build()) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") @@ -1393,11 +1393,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") @@ -1438,11 +1438,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") @@ -1483,11 +1483,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") @@ -1498,11 +1498,11 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1510,18 +1510,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .outputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1529,18 +1529,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .inoutputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1548,18 +1548,18 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .build()) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") @@ -1572,11 +1572,11 @@ public static Submodel createSubmodel7() { .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") @@ -1603,26 +1603,26 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") @@ -1630,16 +1630,16 @@ public static Submodel createSubmodel7() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(null) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") @@ -1650,11 +1650,11 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1663,16 +1663,16 @@ public static Submodel createSubmodel7() { .build()) .min(null) .max("100") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") @@ -1681,18 +1681,18 @@ public static Submodel createSubmodel7() { .build()) .min("0") .max(null) - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AASSubmodelElements.SUBMODEL_ELEMENT) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1702,11 +1702,11 @@ public static Submodel createSubmodel7() { .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") @@ -1718,11 +1718,11 @@ public static Submodel createSubmodel7() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") @@ -1735,11 +1735,11 @@ public static Submodel createSubmodel7() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") @@ -1751,11 +1751,11 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") @@ -1769,7 +1769,7 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) @@ -1798,7 +1798,7 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .description(Arrays.asList( + .descriptions(Arrays.asList( new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) @@ -1835,7 +1835,7 @@ public static ConceptDescription createConceptDescription4() { .build()) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( + .preferredNames(Arrays.asList( new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) @@ -1845,7 +1845,7 @@ public static ConceptDescription createConceptDescription4() { .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Units/SpaceUnit") @@ -1858,21 +1858,21 @@ public static ConceptDescription createConceptDescription4() { .value("TEST") .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueID(new DefaultReference.Builder() + .value("http://acplt.org/valueId/ExamplevalueId2") + .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 73681dc8b..a57f4a418 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; @@ -43,7 +44,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; import org.junit.Assert; @@ -144,11 +145,11 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) @@ -156,10 +157,10 @@ public static AssetAdministrationShell createAAS() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(DEVICE_ID) .value(QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG) - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) @@ -200,7 +201,7 @@ public static AssetAdministrationShell createAAS() { public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) @@ -210,7 +211,7 @@ public static Submodel createSubmodelTechnicalData() { .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) @@ -220,7 +221,7 @@ public static Submodel createSubmodelTechnicalData() { .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_TECHNICAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build()) .build(); } @@ -231,7 +232,7 @@ public static Submodel createSubmodelOperationalData() { .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) @@ -241,7 +242,7 @@ public static Submodel createSubmodelOperationalData() { .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) .value(SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.INTEGER) + .valueType(DataTypeDefXsd.INTEGER) .build()) .build(); } @@ -252,7 +253,7 @@ public static Submodel createSubmodelDocumentation() { .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) @@ -261,7 +262,7 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) @@ -270,10 +271,10 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) - .valueType(DataTypeDefXSD.STRING) + .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .semanticID(new DefaultReference.Builder() + .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) @@ -364,7 +365,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) @@ -401,7 +402,7 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) - .unitID(new DefaultReference.Builder() + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 40652ceb7..b9bc9de24 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +36,7 @@ public class CustomProperty implements Property { protected Reference valueId; - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; protected List qualifiers; @@ -82,12 +83,12 @@ public boolean equals(Object obj) { } @Override - final public DataTypeDefXSD getValueType() { + final public DataTypeDefXsd getValueType() { return this.valueType; } @Override - final public void setValueType(DataTypeDefXSD dataType) { + final public void setValueType(DataTypeDefXsd dataType) { this.valueType = dataType; } @@ -102,12 +103,12 @@ final public void setValue(String value) { } @Override - final public Reference getValueID() { + final public Reference getValueId() { return valueId; } @Override - final public void setValueID(Reference valueId) { + final public void setValueId(Reference valueId) { this.valueId = valueId; } @@ -122,22 +123,22 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescriptions() { return description; } @Override - final public void setDescription(List description) { + final public void setDescriptions(List description) { this.description = description; } @Override - final public List getDisplayName() { + final public List getDisplayNames() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayNames(List displayName) { this.displayName = displayName; } @@ -172,12 +173,12 @@ final public void setEmbeddedDataSpecifications(List } @Override - final public Reference getSemanticID() { + final public Reference getSemanticId() { return semanticId; } @Override - final public void setSemanticID(Reference semanticId) { + final public void setSemanticId(Reference semanticId) { this.semanticId = semanticId; } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index e420e8e53..5ca0161db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { @@ -41,16 +42,16 @@ public interface SubmodelElementListMixin { public void setSemanticIdListElement(Reference semanticIdListElement); @JsonProperty("typeValueListElement") - public AASSubmodelElements getTypeValueListElement(); + public AasSubmodelElements getTypeValueListElement(); @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AASSubmodelElements typeValueListElement); + public void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JsonProperty("valueTypeListElement") - public DataTypeDefXSD getValueTypeListElement(); + public DataTypeDefXsd getValueTypeListElement(); @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") public Collection getValues(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 6297303af..7cf92fa72 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -1,5 +1,6 @@ /* * Copyright 2022 jab. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; public class Examples { @@ -50,11 +51,11 @@ public class Examples { .id("https://example.org/AssetAdministrationShell") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetID("https://example.org/Asset") - .specificAssetIds(new DefaultSpecificAssetID.Builder() + .globalAssetId("https://example.org/Asset") + .specificAssetIds(new DefaultSpecificAssetId.Builder() .name("ExampleAssetId") .value("ExampleValue") - .externalSubjectID(new DefaultReference.Builder() + .externalSubjectId(new DefaultReference.Builder() .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java index e795faa56..2b26e1ece 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; @@ -14,6 +31,6 @@ public class ValueReferencePairNodeDeserializer implements CustomJsonNodeDeseria public ValueReferencePair readValue(JsonNode node, JsonParser parser) throws IOException { String value = node.get("value").asText(); Reference valueId = DeserializationHelper.createInstanceFromNode(parser, node.get("valueId"), Reference.class); - return new DefaultValueReferencePair.Builder().value(value).valueID(valueId).build(); + return new DefaultValueReferencePair.Builder().value(value).valueId(valueId).build(); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index 19304faf5..1ab503390 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; @@ -29,11 +30,11 @@ public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index ab98d6027..6d9a72164 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -36,7 +37,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXSD valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index 0af6f1b47..ef49d195c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; @@ -28,5 +29,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXSD getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index bd95e887b..cbad40cc0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,8 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.AASSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; @@ -48,14 +49,14 @@ public interface SubmodelElementListMixin { public void setSemanticIdListElement(Reference semanticIdListElement); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typeValueListElement") - public AASSubmodelElements getTypeValueListElement(); + public AasSubmodelElements getTypeValueListElement(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typeValueListElement") - public void setTypeValueListElement(AASSubmodelElements typeValueListElement); + public void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueTypeListElement") - public DataTypeDefXSD getValueTypeListElement(); + public DataTypeDefXsd getValueTypeListElement(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 1e35f8981..6ca6b6c65 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; @@ -125,7 +126,7 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException .value(new DefaultProperty.Builder() .idShort("inputProperty") .value("1") - .valueType(DataTypeDefXSD.INT) + .valueType(DataTypeDefXsd.INT) .build()) .build()) .build()) @@ -137,7 +138,7 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException @Test public void testGYear() throws SerializationException, SAXException { - Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXSD.GYEAR).build()).build(); + Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); Set errors = validateAgainstXsdSchema(xml); assertTrue(errors.isEmpty()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java similarity index 59% rename from model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java rename to model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index 23009d63b..b5216b2d5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AASSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,92 +23,92 @@ /** * Enumeration of all possible elements of a 'SubmodelElementList'. */ -@IRI("aas:AASSubmodelElements") -public enum AASSubmodelElements { +@IRI("aas:AasSubmodelElements") +public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AASSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index c50f75ab4..fe6b51a24 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,9 +25,9 @@ * Strings with language tags */ @KnownSubtypes({ - @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), @KnownSubtypes.Type(value = LangStringPreferredNameTypeIec61360.class), @KnownSubtypes.Type(value = LangStringShortNameTypeIec61360.class), + @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), @KnownSubtypes.Type(value = LangStringNameType.class), @KnownSubtypes.Type(value = LangStringTextType.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index e5c3ff60f..19390fc5c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,23 +30,23 @@ public interface AdministrativeInformation extends HasDataSpecification { /** - * The subject ID of the subject responsible for making the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version * - * @return Returns the Reference for the property creator. + * @return Returns the String for the property version. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - Reference getCreator(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + String getVersion(); /** - * The subject ID of the subject responsible for making the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version * - * @param creator desired value for the property creator. + * @param version desired value for the property version. */ - void setCreator(Reference creator); + void setVersion(String version); /** * Revision of the element. @@ -67,41 +68,41 @@ public interface AdministrativeInformation extends HasDataSpecification { void setRevision(String revision); /** - * Identifier of the template that guided the creation of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @return Returns the String for the property templateID. + * @return Returns the Reference for the property creator. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID") - String getTemplateID(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + Reference getCreator(); /** - * Identifier of the template that guided the creation of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @param templateID desired value for the property templateID. + * @param creator desired value for the property creator. */ - void setTemplateID(String templateID); + void setCreator(Reference creator); /** - * Version of the element. + * Identifier of the template that guided the creation of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId * - * @return Returns the String for the property version. + * @return Returns the String for the property templateId. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") - String getVersion(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + String getTemplateId(); /** - * Version of the element. + * Identifier of the template that guided the creation of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId * - * @param version desired value for the property version. + * @param templateId desired value for the property templateId. */ - void setVersion(String version); + void setTemplateId(String templateId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index 841ea2032..788534fba 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 238314362..3e0b0b9cb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,42 +31,42 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** * References to submodels of the AAS. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 517cb9db6..ae48cae15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -50,83 +51,83 @@ public interface AssetInformation { void setAssetKind(AssetKind assetKind); /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetID'. + * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @return Returns the String for the property assetType. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - String getAssetType(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") + String getGlobalAssetId(); /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetID'. + * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @param assetType desired value for the property assetType. + * @param globalAssetId desired value for the property globalAssetId. */ - void setAssetType(String assetType); + void setGlobalAssetId(String globalAssetId); /** - * Thumbnail of the asset represented by the Asset Administration Shell. + * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial + * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * - * @return Returns the Resource for the property defaultThumbnail. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + List getSpecificAssetIds(); /** - * Thumbnail of the asset represented by the Asset Administration Shell. + * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial + * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * - * @param defaultThumbnail desired value for the property defaultThumbnail. + * @param specificAssetIds desired value for the property specificAssetIds. */ - void setDefaultThumbnail(Resource defaultThumbnail); + void setSpecificAssetIds(List specificAssetIds); /** - * Global identifier of the asset the AAS is representing. + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType * - * @return Returns the String for the property globalAssetID. + * @return Returns the String for the property assetType. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID") - String getGlobalAssetID(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + String getAssetType(); /** - * Global identifier of the asset the AAS is representing. + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType * - * @param globalAssetID desired value for the property globalAssetID. + * @param assetType desired value for the property assetType. */ - void setGlobalAssetID(String globalAssetID); + void setAssetType(String assetType); /** - * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial - * number etc. + * Thumbnail of the asset represented by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail * - * @return Returns the List of SpecificAssetIDs for the property specificAssetIds. + * @return Returns the Resource for the property defaultThumbnail. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") - List getSpecificAssetIds(); + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); /** - * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial - * number etc. + * Thumbnail of the asset represented by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail * - * @param specificAssetIds desired value for the property specificAssetIds. + * @param defaultThumbnail desired value for the property defaultThumbnail. */ - void setSpecificAssetIds(List specificAssetIds); + void setDefaultThumbnail(Resource defaultThumbnail); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index 70ea05c93..74400ccd9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 2364f88f2..1dc3622d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -28,6 +29,27 @@ }) public interface BasicEventElement extends EventElement { + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @return Returns the Reference for the property observed. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + Reference getObserved(); + + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @param observed desired value for the property observed. + */ + void setObserved(Reference observed); + /** * Direction of event. * @@ -48,42 +70,44 @@ public interface BasicEventElement extends EventElement { void setDirection(Direction direction); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @return Returns the String for the property lastUpdate. + * @return Returns the StateOfEvent for the property state. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + StateOfEvent getState(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @param lastUpdate desired value for the property lastUpdate. + * @param state desired value for the property state. */ - void setLastUpdate(String lastUpdate); + void setState(StateOfEvent state); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @return Returns the String for the property maxInterval. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @param maxInterval desired value for the property maxInterval. + * @param messageTopic desired value for the property messageTopic. */ - void setMaxInterval(String maxInterval); + void setMessageTopic(String messageTopic); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. @@ -109,25 +133,23 @@ public interface BasicEventElement extends EventElement { void setMessageBroker(Reference messageBroker); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @param messageTopic desired value for the property messageTopic. + * @param lastUpdate desired value for the property lastUpdate. */ - void setMessageTopic(String messageTopic); + void setLastUpdate(String lastUpdate); /** * For input direction, reports on the maximum frequency, the software entity behind the respective @@ -151,43 +173,22 @@ public interface BasicEventElement extends EventElement { void setMinInterval(String minInterval); /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - - /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @param state desired value for the property state. + * @param maxInterval desired value for the property maxInterval. */ - void setState(StateOfEvent state); + void setMaxInterval(String maxInterval); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 8ea957078..4d0e69a95 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,41 +31,41 @@ public interface Blob extends DataElement { /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java index 26cb02ec6..de73e72cf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index a18fe9266..f9837b1c0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,18 +36,18 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { * * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @return Returns the List of References for the property isCaseOf. + * @return Returns the List of References for the property isCaseOfs. */ @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - List getIsCaseOf(); + List getIsCaseOfs(); /** * Reference to an external definition the concept is compatible to or was derived from. * * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @param isCaseOf desired value for the property isCaseOf. + * @param isCaseOfs desired value for the property isCaseOfs. */ - void setIsCaseOf(List isCaseOf); + void setIsCaseOfs(List isCaseOfs); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index 3c848efab..4b2208252 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index c6ba9d955..5c99e7daf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index c0b5a1b18..48278c09a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -31,99 +32,80 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType - * - * @return Returns the DataTypeIec61360 for the property dataType. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/dataType") - DataTypeIec61360 getDataType(); - - /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType - * - * @param dataType desired value for the property dataType. - */ - void setDataType(DataTypeIec61360 dataType); - - /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @return Returns the List of LangStringDefinitionTypeIEC61360s for the property definition. + * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredNames. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/definition") - List getDefinition(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + List getPreferredNames(); /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @param definition desired value for the property definition. + * @param preferredNames desired value for the property preferredNames. */ - void setDefinition(List definition); + void setPreferredNames(List preferredNames); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @return Returns the LevelType for the property levelType. + * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortNames. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType") - LevelType getLevelType(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + List getShortNames(); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @param levelType desired value for the property levelType. + * @param shortNames desired value for the property shortNames. */ - void setLevelType(LevelType levelType); + void setShortNames(List shortNames); /** - * Preferred name + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @return Returns the List of LangStringPreferredNameTypeIEC61360s for the property preferredName. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/preferredName") - List getPreferredName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + String getUnit(); /** - * Preferred name + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @param preferredName desired value for the property preferredName. + * @param unit desired value for the property unit. */ - void setPreferredName(List preferredName); + void setUnit(String unit); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @return Returns the List of LangStringShortNameTypeIEC61360s for the property shortName. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/shortName") - List getShortName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + Reference getUnitId(); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @param shortName desired value for the property shortName. + * @param unitId desired value for the property unitId. */ - void setShortName(List shortName); + void setUnitId(Reference unitId); /** * Source of definition @@ -133,7 +115,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** @@ -153,7 +135,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") String getSymbol(); /** @@ -166,61 +148,42 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { void setSymbol(String symbol); /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit - * - * @return Returns the String for the property unit. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unit") - String getUnit(); - - /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit - * - * @param unit desired value for the property unit. - */ - void setUnit(String unit); - - /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitID + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @return Returns the Reference for the property unitID. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unitID") - Reference getUnitID(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitID + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @param unitID desired value for the property unitID. + * @param dataType desired value for the property dataType. */ - void setUnitID(Reference unitID); + void setDataType(DataTypeIec61360 dataType); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @return Returns the String for the property value. + * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definitions. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + List getDefinitions(); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @param value desired value for the property value. + * @param definitions desired value for the property definitions. */ - void setValue(String value); + void setDefinitions(List definitions); /** * Value Format @@ -229,7 +192,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** @@ -248,7 +211,7 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") ValueList getValueList(); /** @@ -260,4 +223,42 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { */ void setValueList(ValueList valueList); + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @return Returns the LevelType for the property levelType. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + LevelType getLevelType(); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @param levelType desired value for the property levelType. + */ + void setLevelType(LevelType levelType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java deleted file mode 100644 index 7452b2596..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXSD.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - - -/** - * Enumeration listing all XSD anySimpleTypes - */ -@IRI("aas:DataTypeDefXSD") -public enum DataTypeDefXSD { - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/AnyUri") - ANY_URI, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Base64Binary") - BASE64BINARY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Boolean") - BOOLEAN, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Byte") - BYTE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Date") - DATE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/DateTime") - DATE_TIME, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Decimal") - DECIMAL, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Double") - DOUBLE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Duration") - DURATION, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Float") - FLOAT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GDay") - GDAY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GMonth") - GMONTH, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GMonthDay") - GMONTH_DAY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GYear") - GYEAR, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/GYearMonth") - GYEAR_MONTH, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/HexBinary") - HEX_BINARY, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Int") - INT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Integer") - INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Long") - LONG, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NegativeInteger") - NEGATIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NonNegativeInteger") - NON_NEGATIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/NonPositiveInteger") - NON_POSITIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/PositiveInteger") - POSITIVE_INTEGER, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Short") - SHORT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/String") - STRING, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/Time") - TIME, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedByte") - UNSIGNED_BYTE, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedInt") - UNSIGNED_INT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedLong") - UNSIGNED_LONG, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXSD/UnsignedShort") - UNSIGNED_SHORT; - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index a77873cda..91e2768a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIEC61360") +@IRI("aas:DataTypeIec61360") public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/File") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Html") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIEC61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 9a556a503..471cd52f5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index 5be85af48..a698dd362 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 17c09503a..5ac6854f6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,6 +30,27 @@ }) public interface Entity extends SubmodelElement { + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); + /** * Describes whether the entity is a co-managed entity or a self-managed entity. * @@ -51,21 +73,21 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetID + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @return Returns the String for the property globalAssetID. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetID") - String getGlobalAssetID(); + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") + String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetID + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @param globalAssetID desired value for the property globalAssetID. + * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented @@ -73,10 +95,10 @@ public interface Entity extends SubmodelElement { * * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @return Returns the List of SpecificAssetIDs for the property specificAssetIds. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - List getSpecificAssetIds(); + List getSpecificAssetIds(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented @@ -86,27 +108,6 @@ public interface Entity extends SubmodelElement { * * @param specificAssetIds desired value for the property specificAssetIds. */ - void setSpecificAssetIds(List specificAssetIds); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); + void setSpecificAssetIds(List specificAssetIds); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 5fec4fe06..875c8dfb4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 5485872b9..92d8c964e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -49,41 +50,41 @@ public interface Environment { void setAssetAdministrationShells(List assetAdministrationShells); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java index 02818c712..074938c82 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index f971df611..3e99c1c30 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,120 +30,122 @@ public interface EventPayload { /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @return Returns the Reference for the property observableReference. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + Reference getSource(); /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @param observableReference desired value for the property observableReference. + * @param source desired value for the property source. */ - void setObservableReference(Reference observableReference); + void setSource(Reference source); /** - * 'semanticID' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @return Returns the Reference for the property observableSemanticID. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID") - Reference getObservableSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * 'semanticID' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @param observableSemanticID desired value for the property observableSemanticID. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setObservableSemanticID(Reference observableSemanticID); + void setSourceSemanticId(Reference sourceSemanticId); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @return Returns the byte[] for the property payload. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - byte[] getPayload(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + Reference getObservableReference(); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @param payload desired value for the property payload. + * @param observableReference desired value for the property observableReference. */ - void setPayload(byte[] payload); + void setObservableReference(Reference observableReference); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @param source desired value for the property source. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSource(Reference source); + void setObservableSemanticId(Reference observableSemanticId); /** - * 'semanticID' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @return Returns the Reference for the property sourceSemanticID. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID") - Reference getSourceSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + String getTopic(); /** - * 'semanticID' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @param sourceSemanticID desired value for the property sourceSemanticID. + * @param topic desired value for the property topic. */ - void setSourceSemanticID(Reference sourceSemanticID); + void setTopic(String topic); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectID + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * - * @return Returns the Reference for the property subjectID. + * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectID") - Reference getSubjectID(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectID + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * - * @param subjectID desired value for the property subjectID. + * @param subjectId desired value for the property subjectId. */ - void setSubjectID(Reference subjectID); + void setSubjectId(Reference subjectId); /** * Timestamp in UTC, when this event was triggered. @@ -164,24 +167,22 @@ public interface EventPayload { void setTimeStamp(String timeStamp); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @return Returns the String for the property topic. + * @return Returns the byte[] for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + byte[] getPayload(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @param topic desired value for the property topic. + * @param payload desired value for the property payload. */ - void setTopic(String topic); + void setPayload(byte[] payload); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index 9638fe412..07f6b1eec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -49,23 +50,23 @@ public interface Extension extends HasSemantics { void setName(String name); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @return Returns the List of References for the property refersTo. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - List getRefersTo(); + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @param refersTo desired value for the property refersTo. + * @param valueType desired value for the property valueType. */ - void setRefersTo(List refersTo); + void setValueType(DataTypeDefXsd valueType); /** * Value of the extension @@ -87,22 +88,22 @@ public interface Extension extends HasSemantics { void setValue(String value); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @return Returns the DataTypeDefXSD for the property valueType. + * @return Returns the List of References for the property refersTos. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - DataTypeDefXSD getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + List getRefersTos(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTos desired value for the property refersTos. */ - void setValueType(DataTypeDefXSD valueType); + void setRefersTos(List refersTos); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index 6bf0dfc6c..0640b0862 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,41 +30,41 @@ public interface File extends DataElement { /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index c266eda1c..511c51ce5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -26,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = ConceptDescription.class), + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 4da4a2342..624ff047b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 420fed252..9a4bb07ca 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index a5933022c..12e336f11 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,7 +25,7 @@ * Element that can have a semantic definition plus some supplemental semantic definitions. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SpecificAssetID.class), + @KnownSubtypes.Type(value = SpecificAssetId.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), @KnownSubtypes.Type(value = Extension.class), @@ -36,22 +37,22 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticID + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * - * @return Returns the Reference for the property semanticID. + * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - Reference getSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticID + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * - * @param semanticID desired value for the property semanticID. + * @param semanticId desired value for the property semanticId. */ - void setSemanticID(Reference semanticID); + void setSemanticId(Reference semanticId); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index 325a3d6d8..0f328c7d1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index e58033a6a..c91f83277 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index c08fef3b8..fd44ac144 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java index a2153c56c..0e53dde47 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java index 510fa9ff7..c28a05bbb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java index 970690271..12de5f4d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java index dfa79c706..fecf969e6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java index dc960b950..2fffe3cd8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index 36ca14e5b..df6a1ac15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,25 +30,6 @@ }) public interface LevelType { - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @return Returns the boolean for the property max. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/max") - boolean getMax(); - - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @param max desired value for the property max. - */ - void setMax(boolean max); - /** * Minimum of the value * @@ -105,4 +87,23 @@ public interface LevelType { */ void setTyp(boolean typ); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @return Returns the boolean for the property max. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/max") + boolean getMax(); + + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @param max desired value for the property max. + */ + void setMax(boolean max); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java index 070e48af7..50aba3530 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index e2ca85aa4..d828bec39 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,37 +35,37 @@ public interface MultiLanguageProperty extends DataElement { * * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @return Returns the List of LangStringTextTypes for the property value. + * @return Returns the List of LangStringTextTypes for the property values. */ @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - List getValue(); + List getValues(); /** * The value of the property instance. * * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @param value desired value for the property value. + * @param values desired value for the property values. */ - void setValue(List value); + void setValues(List values); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * - * @param valueID desired value for the property valueID. + * @param valueId desired value for the property valueId. */ - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 18bb33559..17a2ea927 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,25 +30,6 @@ }) public interface Operation extends SubmodelElement { - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - /** * Input parameter of the operation. * @@ -86,4 +68,23 @@ public interface Operation extends SubmodelElement { */ void setOutputVariables(List outputVariables); + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index 7b5cf13d6..d62fa0440 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index 13a195fb3..7df12e7ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -28,6 +29,25 @@ }) public interface Property extends DataElement { + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The value of the property instance. * @@ -50,39 +70,20 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueID + * More information under https://admin-shell.io/aas/3/0/Property/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueID + * More information under https://admin-shell.io/aas/3/0/Property/valueId * - * @param valueID desired value for the property valueID. - */ - void setValueID(Reference valueID); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @return Returns the DataTypeDefXSD for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - DataTypeDefXSD getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @param valueType desired value for the property valueType. + * @param valueId desired value for the property valueId. */ - void setValueType(DataTypeDefXSD valueType); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index c7dcf966d..da02ca695 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index d78e990a8..624d79ff3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,6 +68,25 @@ public interface Qualifier extends HasSemantics { */ void setType(String type); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The qualifier value is the value of the qualifier. * @@ -89,39 +109,20 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueID + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueID + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * - * @param valueID desired value for the property valueID. - */ - void setValueID(Reference valueID); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @return Returns the DataTypeDefXSD for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - DataTypeDefXSD getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @param valueType desired value for the property valueType. + * @param valueId desired value for the property valueId. */ - void setValueType(DataTypeDefXSD valueType); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 776c50f89..844a14308 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -26,7 +27,7 @@ public enum QualifierKind { /** - * qualifies the semantic definition the element is referring to ('semanticID') + * qualifies the semantic definition the element is referring to ('semanticId') */ @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index c9d70b9eb..1ff17790c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -29,23 +30,23 @@ public interface Range extends DataElement { /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); /** * The minimum value of the range. @@ -67,22 +68,22 @@ public interface Range extends DataElement { void setMin(String min); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @return Returns the DataTypeDefXSD for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - DataTypeDefXSD getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXSD valueType); + void setMax(String max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index b8a84a829..f85391a54 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = Identifiable.class), - @KnownSubtypes.Type(value = SubmodelElement.class) + @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = Identifiable.class) }) public interface Referable extends HasExtensions { @@ -51,62 +52,62 @@ public interface Referable extends HasExtensions { void setCategory(String category); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @return Returns the List of LangStringTextTypes for the property description. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - List getDescription(); + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @param description desired value for the property description. + * @param idShort desired value for the property idShort. */ - void setDescription(List description); + void setIdShort(String idShort); /** * Display name. Can be provided in several languages. * * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @return Returns the List of LangStringNameTypes for the property displayName. + * @return Returns the List of LangStringNameTypes for the property displayNames. */ @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - List getDisplayName(); + List getDisplayNames(); /** * Display name. Can be provided in several languages. * * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @param displayName desired value for the property displayName. + * @param displayNames desired value for the property displayNames. */ - void setDisplayName(List displayName); + void setDisplayNames(List displayNames); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @return Returns the String for the property idShort. + * @return Returns the List of LangStringTextTypes for the property descriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + List getDescriptions(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @param idShort desired value for the property idShort. + * @param descriptions desired value for the property descriptions. */ - void setIdShort(String idShort); + void setDescriptions(List descriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index e338f7e63..2aa779da6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,60 +31,60 @@ public interface Reference { /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); /** - * 'semanticID' of the referenced model element ('type' = 'ModelReference'). + * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticID + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * - * @return Returns the Reference for the property referredSemanticID. + * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticID") - Reference getReferredSemanticID(); + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + Reference getReferredSemanticId(); /** - * 'semanticID' of the referenced model element ('type' = 'ModelReference'). + * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticID + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * - * @param referredSemanticID desired value for the property referredSemanticID. + * @param referredSemanticId desired value for the property referredSemanticId. */ - void setReferredSemanticID(Reference referredSemanticID); + void setReferredSemanticId(Reference referredSemanticId); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index f94d3b5f9..95fe8bd7e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 6182c32e0..305a50ee9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index ab0b90430..4caefc472 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index 78e144ece..5c01c0149 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,41 +31,41 @@ public interface Resource { /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java deleted file mode 100644 index fd90bddd3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetID.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetID; - - -/** - * A specific asset ID describes a generic supplementary identifying attribute of the asset. - */ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSpecificAssetID.class) -}) -public interface SpecificAssetID extends HasSemantics { - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID - * - * @return Returns the Reference for the property externalSubjectID. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID") - Reference getExternalSubjectID(); - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID - * - * @param externalSubjectID desired value for the property externalSubjectID. - */ - void setExternalSubjectID(Reference externalSubjectID); - - /** - * Name of the identifier - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/name - * - * @return Returns the String for the property name. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/name") - String getName(); - - /** - * Name of the identifier - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/name - * - * @param name desired value for the property name. - */ - void setName(String name); - - /** - * The value of the specific asset identifier with the corresponding name. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/value") - String getValue(); - - /** - * The value of the specific asset identifier with the corresponding name. - * - * More information under https://admin-shell.io/aas/3/0/SpecificAssetID/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index 67ec72fe8..c976edd7a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 132c85b2d..eeffb4150 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -27,7 +28,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { +public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { /** * A submodel consists of zero or more submodel elements. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index 8e9f1af77..c18a4f6bb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Referable, Qualifiable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index ccfffd58b..67c357f26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -18,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.Collection; +import java.util.List; /** @@ -35,18 +36,18 @@ public interface SubmodelElementCollection extends SubmodelElement { * * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @return Returns the Collection of SubmodelElements for the property value. + * @return Returns the List of SubmodelElements for the property values. */ @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - Collection getValue(); + List getValues(); /** * Submodel element contained in the collection. * * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @param value desired value for the property value. + * @param values desired value for the property values. */ - void setValue(Collection value); + void setValues(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index f83b4eb55..7d5895e6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -53,31 +54,31 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * - * @return Returns the Reference for the property semanticIDListElement. + * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement") - Reference getSemanticIDListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * - * @param semanticIDListElement desired value for the property semanticIDListElement. + * @param semanticIdListElement desired value for the property semanticIdListElement. */ - void setSemanticIDListElement(Reference semanticIDListElement); + void setSemanticIdListElement(Reference semanticIdListElement); /** * The submodel element type of the submodel elements contained in the list. * * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * - * @return Returns the AASSubmodelElements for the property typeValueListElement. + * @return Returns the AasSubmodelElements for the property typeValueListElement. */ @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") - AASSubmodelElements getTypeValueListElement(); + AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. @@ -86,44 +87,44 @@ public interface SubmodelElementList extends SubmodelElement { * * @param typeValueListElement desired value for the property typeValueListElement. */ - void setTypeValueListElement(AASSubmodelElements typeValueListElement); + void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property value. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - List getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @param value desired value for the property value. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValue(List value); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @return Returns the DataTypeDefXSD for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property values. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - DataTypeDefXSD getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") + List getValues(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param values desired value for the property values. */ - void setValueTypeListElement(DataTypeDefXSD valueTypeListElement); + void setValues(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index 3fa7f75ce..d5e66885c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 8b432070b..426ff7b51 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -30,7 +31,7 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in 'valueID'. + * The value of the referenced concept definition of the value in 'valueId'. * * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * @@ -40,7 +41,7 @@ public interface ValueReferencePair { String getValue(); /** - * The value of the referenced concept definition of the value in 'valueID'. + * The value of the referenced concept definition of the value in 'valueId'. * * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * @@ -51,20 +52,20 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueID + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * - * @return Returns the Reference for the property valueID. + * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueID") - Reference getValueID(); + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueID + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * - * @param valueID desired value for the property valueID. + * @param valueId desired value for the property valueId. */ - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index a16de81f0..3a6ada117 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index 14a7ca309..b7e0c47c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 283f216a7..519f45bdb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index 25ccb9399..88fefd0bc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -25,13 +26,13 @@ public abstract class AdministrativeInformationBuilder { /** - * This function allows setting a value for creator + * This function allows setting a value for version * - * @param creator desired value to be set - * @return Builder object with new value for creator + * @param version desired value to be set + * @return Builder object with new value for version */ - public B creator(Reference creator) { - getBuildingInstance().setCreator(creator); + public B version(String version) { + getBuildingInstance().setVersion(version); return getSelf(); } @@ -47,24 +48,24 @@ public B revision(String revision) { } /** - * This function allows setting a value for templateID + * This function allows setting a value for creator * - * @param templateID desired value to be set - * @return Builder object with new value for templateID + * @param creator desired value to be set + * @return Builder object with new value for creator */ - public B templateID(String templateID) { - getBuildingInstance().setTemplateID(templateID); + public B creator(Reference creator) { + getBuildingInstance().setCreator(creator); return getSelf(); } /** - * This function allows setting a value for version + * This function allows setting a value for templateId * - * @param version desired value to be set - * @return Builder object with new value for version + * @param templateId desired value to be set + * @return Builder object with new value for templateId */ - public B version(String version) { - getBuildingInstance().setVersion(version); + public B templateId(String templateId) { + getBuildingInstance().setTemplateId(templateId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 663bd819f..6dd02e7d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -89,13 +90,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -121,6 +122,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -133,57 +156,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -208,26 +231,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 45b103666..2015b9c28 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } @@ -122,57 +123,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index cb3798301..3794191d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -17,7 +18,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import java.util.List; @@ -37,57 +38,57 @@ public B assetKind(AssetKind assetKind) { } /** - * This function allows setting a value for assetType + * This function allows setting a value for globalAssetId * - * @param assetType desired value to be set - * @return Builder object with new value for assetType + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId */ - public B assetType(String assetType) { - getBuildingInstance().setAssetType(assetType); + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } /** - * This function allows setting a value for defaultThumbnail + * This function allows setting a value for specificAssetIds * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for globalAssetID + * This function allows adding a value to the List specificAssetIds * - * @param globalAssetID desired value to be set - * @return Builder object with new value for globalAssetID + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds */ - public B globalAssetID(String globalAssetID) { - getBuildingInstance().setGlobalAssetID(globalAssetID); + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for specificAssetIds + * This function allows setting a value for assetType * - * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetIds + * @param assetType desired value to be set + * @return Builder object with new value for assetType */ - public B specificAssetIds(List specificAssetIds) { - getBuildingInstance().setSpecificAssetIds(specificAssetIds); + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); return getSelf(); } /** - * This function allows adding a value to the List specificAssetIds + * This function allows setting a value for defaultThumbnail * - * @param specificAssetIds desired value to be added - * @return Builder object with new value for specificAssetIds + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail */ - public B specificAssetIds(SpecificAssetID specificAssetIds) { - getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 01edbf0a3..353bf806d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,6 +23,17 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for observed + * + * @param observed desired value to be set + * @return Builder object with new value for observed + */ + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + /** * This function allows setting a value for direction * @@ -34,24 +46,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for state * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param state desired value to be set + * @return Builder object with new value for state */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for messageTopic * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -67,13 +79,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for lastUpdate * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } @@ -89,24 +101,13 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - - /** - * This function allows setting a value for state + * This function allows setting a value for maxInterval * - * @param state desired value to be set - * @return Builder object with new value for state + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -133,13 +134,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -165,6 +166,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -177,57 +200,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -252,26 +275,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index 43f20de00..b59c42e61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -66,13 +67,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -98,6 +99,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -110,57 +133,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -185,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index 7e27dad1f..ce013e25b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index f62d73756..9fd0aea26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,13 +45,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -76,6 +77,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -88,57 +111,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -163,26 +186,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 65e871bb3..590b49285 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,24 +24,24 @@ public abstract class ConceptDescriptionBuilder { /** - * This function allows setting a value for isCaseOf + * This function allows setting a value for isCaseOfs * - * @param isCaseOf desired value to be set - * @return Builder object with new value for isCaseOf + * @param isCaseOfs desired value to be set + * @return Builder object with new value for isCaseOfs */ - public B isCaseOf(List isCaseOf) { - getBuildingInstance().setIsCaseOf(isCaseOf); + public B isCaseOfs(List isCaseOfs) { + getBuildingInstance().setIsCaseOfs(isCaseOfs); return getSelf(); } /** - * This function allows adding a value to the List isCaseOf + * This function allows adding a value to the List isCaseOfs * * @param isCaseOf desired value to be added - * @return Builder object with new value for isCaseOf + * @return Builder object with new value for isCaseOfs */ public B isCaseOf(Reference isCaseOf) { - getBuildingInstance().getIsCaseOf().add(isCaseOf); + getBuildingInstance().getIsCaseOfs().add(isCaseOf); return getSelf(); } @@ -100,57 +101,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index d02d832fe..dab3a6b43 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,90 +24,68 @@ public abstract class DataSpecificationIec61360Builder { /** - * This function allows setting a value for dataType + * This function allows setting a value for preferredNames * - * @param dataType desired value to be set - * @return Builder object with new value for dataType + * @param preferredNames desired value to be set + * @return Builder object with new value for preferredNames */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangStringDefinitionTypeIec61360 definition) { - getBuildingInstance().getDefinition().add(definition); + public B preferredNames(List preferredNames) { + getBuildingInstance().setPreferredNames(preferredNames); return getSelf(); } /** - * This function allows setting a value for levelType + * This function allows adding a value to the List preferredNames * - * @param levelType desired value to be set - * @return Builder object with new value for levelType + * @param preferredName desired value to be added + * @return Builder object with new value for preferredNames */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); + public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { + getBuildingInstance().getPreferredNames().add(preferredName); return getSelf(); } /** - * This function allows setting a value for preferredName + * This function allows setting a value for shortNames * - * @param preferredName desired value to be set - * @return Builder object with new value for preferredName + * @param shortNames desired value to be set + * @return Builder object with new value for shortNames */ - public B preferredName(List preferredName) { - getBuildingInstance().setPreferredName(preferredName); + public B shortNames(List shortNames) { + getBuildingInstance().setShortNames(shortNames); return getSelf(); } /** - * This function allows adding a value to the List preferredName + * This function allows adding a value to the List shortNames * - * @param preferredName desired value to be added - * @return Builder object with new value for preferredName + * @param shortName desired value to be added + * @return Builder object with new value for shortNames */ - public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { - getBuildingInstance().getPreferredName().add(preferredName); + public B shortName(LangStringShortNameTypeIec61360 shortName) { + getBuildingInstance().getShortNames().add(shortName); return getSelf(); } /** - * This function allows setting a value for shortName + * This function allows setting a value for unit * - * @param shortName desired value to be set - * @return Builder object with new value for shortName + * @param unit desired value to be set + * @return Builder object with new value for unit */ - public B shortName(List shortName) { - getBuildingInstance().setShortName(shortName); + public B unit(String unit) { + getBuildingInstance().setUnit(unit); return getSelf(); } /** - * This function allows adding a value to the List shortName + * This function allows setting a value for unitId * - * @param shortName desired value to be added - * @return Builder object with new value for shortName + * @param unitId desired value to be set + * @return Builder object with new value for unitId */ - public B shortName(LangStringShortNameTypeIec61360 shortName) { - getBuildingInstance().getShortName().add(shortName); + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); return getSelf(); } @@ -133,35 +112,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for unit + * This function allows setting a value for dataType * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B dataType(DataTypeIec61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows setting a value for unitID + * This function allows setting a value for definitions * - * @param unitID desired value to be set - * @return Builder object with new value for unitID + * @param definitions desired value to be set + * @return Builder object with new value for definitions */ - public B unitID(Reference unitID) { - getBuildingInstance().setUnitID(unitID); + public B definitions(List definitions) { + getBuildingInstance().setDefinitions(definitions); return getSelf(); } /** - * This function allows setting a value for value + * This function allows adding a value to the List definitions * - * @param value desired value to be set - * @return Builder object with new value for value + * @param definition desired value to be added + * @return Builder object with new value for definitions */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B definition(LangStringDefinitionTypeIec61360 definition) { + getBuildingInstance().getDefinitions().add(definition); return getSelf(); } @@ -187,4 +166,26 @@ public B valueList(ValueList valueList) { return getSelf(); } + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for levelType + * + * @param levelType desired value to be set + * @return Builder object with new value for levelType + */ + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); + return getSelf(); + } + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index f88b3561e..583f538af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 92e516e17..616dad950 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,6 +22,28 @@ public abstract class EntityBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for statements + * + * @param statements desired value to be set + * @return Builder object with new value for statements + */ + public B statements(List statements) { + getBuildingInstance().setStatements(statements); + return getSelf(); + } + + /** + * This function allows adding a value to the List statements + * + * @param statements desired value to be added + * @return Builder object with new value for statements + */ + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); + return getSelf(); + } + /** * This function allows setting a value for entityType * @@ -33,13 +56,13 @@ public B entityType(EntityType entityType) { } /** - * This function allows setting a value for globalAssetID + * This function allows setting a value for globalAssetId * - * @param globalAssetID desired value to be set - * @return Builder object with new value for globalAssetID + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId */ - public B globalAssetID(String globalAssetID) { - getBuildingInstance().setGlobalAssetID(globalAssetID); + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } @@ -49,7 +72,7 @@ public B globalAssetID(String globalAssetID) { * @param specificAssetIds desired value to be set * @return Builder object with new value for specificAssetIds */ - public B specificAssetIds(List specificAssetIds) { + public B specificAssetIds(List specificAssetIds) { getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } @@ -60,33 +83,11 @@ public B specificAssetIds(List specificAssetIds) { * @param specificAssetIds desired value to be added * @return Builder object with new value for specificAssetIds */ - public B specificAssetIds(SpecificAssetID specificAssetIds) { + public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } - /** - * This function allows setting a value for statements - * - * @param statements desired value to be set - * @return Builder object with new value for statements - */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -110,13 +111,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -142,6 +143,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -154,57 +177,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -229,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index d33b72b90..633cf775c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -47,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index d00833379..6aeaad75b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,68 +23,68 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for observableReference + * This function allows setting a value for source * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for observableSemanticID + * This function allows setting a value for sourceSemanticId * - * @param observableSemanticID desired value to be set - * @return Builder object with new value for observableSemanticID + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B observableSemanticID(Reference observableSemanticID) { - getBuildingInstance().setObservableSemanticID(observableSemanticID); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } /** - * This function allows setting a value for payload + * This function allows setting a value for observableReference * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B payload(byte[] payload) { - getBuildingInstance().setPayload(payload); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for source + * This function allows setting a value for observableSemanticId * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for sourceSemanticID + * This function allows setting a value for topic * - * @param sourceSemanticID desired value to be set - * @return Builder object with new value for sourceSemanticID + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B sourceSemanticID(Reference sourceSemanticID) { - getBuildingInstance().setSourceSemanticID(sourceSemanticID); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } /** - * This function allows setting a value for subjectID + * This function allows setting a value for subjectId * - * @param subjectID desired value to be set - * @return Builder object with new value for subjectID + * @param subjectId desired value to be set + * @return Builder object with new value for subjectId */ - public B subjectID(Reference subjectID) { - getBuildingInstance().setSubjectID(subjectID); + public B subjectId(Reference subjectId) { + getBuildingInstance().setSubjectId(subjectId); return getSelf(); } @@ -99,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for topic + * This function allows setting a value for payload * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B payload(byte[] payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java index 57cf35007..801912796 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index bff2490ca..0ec24c7d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -35,57 +36,57 @@ public B name(String name) { } /** - * This function allows setting a value for refersTo + * This function allows setting a value for valueType * - * @param refersTo desired value to be set - * @return Builder object with new value for refersTo + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(List refersTo) { - getBuildingInstance().setRefersTo(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows adding a value to the List refersTo + * This function allows setting a value for value * - * @param refersTo desired value to be added - * @return Builder object with new value for refersTo + * @param value desired value to be set + * @return Builder object with new value for value */ - public B refersTo(Reference refersTo) { - getBuildingInstance().getRefersTo().add(refersTo); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for refersTos * - * @param value desired value to be set - * @return Builder object with new value for value + * @param refersTos desired value to be set + * @return Builder object with new value for refersTos */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B refersTos(List refersTos) { + getBuildingInstance().setRefersTos(refersTos); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows adding a value to the List refersTos * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTo desired value to be added + * @return Builder object with new value for refersTos */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(Reference refersTo) { + getBuildingInstance().getRefersTos().add(refersTo); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index 347317d65..fd6722b88 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -66,13 +67,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -98,6 +99,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -110,57 +133,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -185,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java index f04e9a96c..1b9ca58d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java index 29b8d3f92..1cde475ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java index 8b541147d..daf8ebf61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java index dedd6c541..ad320aab3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java index 697ef25fc..c15ba46bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java index b84b045d8..5ce64c49e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java index 48246a400..4e763ab8d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -20,17 +21,6 @@ public abstract class LevelTypeBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for max - * - * @param max desired value to be set - * @return Builder object with new value for max - */ - public B max(boolean max) { - getBuildingInstance().setMax(max); - return getSelf(); - } - /** * This function allows setting a value for min * @@ -63,4 +53,15 @@ public B typ(boolean typ) { getBuildingInstance().setTyp(typ); return getSelf(); } + + /** + * This function allows setting a value for max + * + * @param max desired value to be set + * @return Builder object with new value for max + */ + public B max(boolean max) { + getBuildingInstance().setMax(max); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index ac14d8c29..d5b2c1905 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -23,35 +24,35 @@ public abstract class MultiLanguagePropertyBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for values * - * @param value desired value to be set - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows adding a value to the List values * * @param value desired value to be added - * @return Builder object with new value for value + * @return Builder object with new value for values */ public B value(LangStringTextType value) { - getBuildingInstance().getValue().add(value); + getBuildingInstance().getValues().add(value); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for valueId * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } @@ -78,13 +79,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -110,6 +111,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -122,57 +145,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -197,26 +220,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 767c3bd8e..bcec85472 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,28 +22,6 @@ public abstract class OperationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for inputVariables * @@ -87,6 +66,28 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -110,13 +111,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -142,6 +143,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -154,57 +177,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -229,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java index 790ee3960..6f429d8d8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index 234ebf561..0bd67baa7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,35 +23,35 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for valueType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for value * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows setting a value for valueId * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } @@ -77,13 +78,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -109,6 +110,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -121,57 +144,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -196,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index ed8646d44..4eeb6a010 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -47,46 +48,46 @@ public B type(String type) { } /** - * This function allows setting a value for value + * This function allows setting a value for valueType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } /** - * This function allows setting a value for valueID + * This function allows setting a value for value * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for valueType + * This function allows setting a value for valueId * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index f265d1700..1bf999673 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -22,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -44,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXSD valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -77,13 +78,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -109,6 +110,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -121,57 +144,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -196,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 734afc5dc..3142190f5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -24,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for keys + * This function allows setting a value for type * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows setting a value for referredSemanticID + * This function allows setting a value for keys * - * @param referredSemanticID desired value to be set - * @return Builder object with new value for referredSemanticID + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B referredSemanticID(Reference referredSemanticID) { - getBuildingInstance().setReferredSemanticID(referredSemanticID); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for type + * This function allows adding a value to the List keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 35af6b641..cf3587b09 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -56,13 +57,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -88,6 +89,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -100,57 +123,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -175,26 +198,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 40079a339..ee8ffa434 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,13 +68,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -99,6 +100,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -111,57 +134,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -186,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index 94a8f727e..f7c03b676 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -21,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java deleted file mode 100644 index 4db2e0991..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIDBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; - -import java.util.List; - - -public abstract class SpecificAssetIDBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for externalSubjectID - * - * @param externalSubjectID desired value to be set - * @return Builder object with new value for externalSubjectID - */ - public B externalSubjectID(Reference externalSubjectID) { - getBuildingInstance().setExternalSubjectID(externalSubjectID); - return getSelf(); - } - - /** - * This function allows setting a value for name - * - * @param name desired value to be set - * @return Builder object with new value for name - */ - public B name(String name) { - getBuildingInstance().setName(name); - return getSelf(); - } - - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } - - /** - * This function allows setting a value for semanticID - * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID - */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index 583367d60..c8fff70dc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -66,79 +67,79 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for administration + * This function allows setting a value for kind * - * @param administration desired value to be set - * @return Builder object with new value for administration + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows setting a value for id + * This function allows setting a value for semanticId * - * @param id desired value to be set - * @return Builder object with new value for id + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B id(String id) { - getBuildingInstance().setId(id); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for supplementalSemanticIds * - * @param category desired value to be set - * @return Builder object with new value for category + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for description + * This function allows adding a value to the List supplementalSemanticIds * - * @param description desired value to be set - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for administration * - * @param description desired value to be added - * @return Builder object with new value for description + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows setting a value for id * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param id desired value to be set + * @return Builder object with new value for id */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for category * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param category desired value to be set + * @return Builder object with new value for category */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } @@ -154,68 +155,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for extensions + * This function allows setting a value for displayNames * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows adding a value to the List displayNames * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows setting a value for semanticID + * This function allows setting a value for descriptions * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows adding a value to the List descriptions * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for extensions * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows setting a value for kind + * This function allows adding a value to the List extensions * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index 44b318ea5..7a97d7a7f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -16,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; -import java.util.Collection; import java.util.List; @@ -24,24 +24,24 @@ public abstract class SubmodelElementCollectionBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for values * - * @param value desired value to be set - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(Collection value) { - getBuildingInstance().setValue(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows adding a value to the List values * * @param value desired value to be added - * @return Builder object with new value for value + * @return Builder object with new value for values */ public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + getBuildingInstance().getValues().add(value); return getSelf(); } @@ -68,13 +68,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -100,6 +100,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -112,57 +134,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -187,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index c81241e0a..a346c19ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,13 +35,13 @@ public B orderRelevant(boolean orderRelevant) { } /** - * This function allows setting a value for semanticIDListElement + * This function allows setting a value for semanticIdListElement * - * @param semanticIDListElement desired value to be set - * @return Builder object with new value for semanticIDListElement + * @param semanticIdListElement desired value to be set + * @return Builder object with new value for semanticIdListElement */ - public B semanticIDListElement(Reference semanticIDListElement) { - getBuildingInstance().setSemanticIDListElement(semanticIDListElement); + public B semanticIdListElement(Reference semanticIdListElement) { + getBuildingInstance().setSemanticIdListElement(semanticIdListElement); return getSelf(); } @@ -50,41 +51,41 @@ public B semanticIDListElement(Reference semanticIDListElement) { * @param typeValueListElement desired value to be set * @return Builder object with new value for typeValueListElement */ - public B typeValueListElement(AASSubmodelElements typeValueListElement) { + public B typeValueListElement(AasSubmodelElements typeValueListElement) { getBuildingInstance().setTypeValueListElement(typeValueListElement); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows setting a value for values * - * @param value desired value to be added - * @return Builder object with new value for value + * @param values desired value to be set + * @return Builder object with new value for values */ - public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + public B values(List values) { + getBuildingInstance().setValues(values); return getSelf(); } /** - * This function allows setting a value for valueTypeListElement + * This function allows adding a value to the List values * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be added + * @return Builder object with new value for values */ - public B valueTypeListElement(DataTypeDefXSD valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(SubmodelElement value) { + getBuildingInstance().getValues().add(value); return getSelf(); } @@ -111,13 +112,13 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for semanticID + * This function allows setting a value for semanticId * - * @param semanticID desired value to be set - * @return Builder object with new value for semanticID + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B semanticID(Reference semanticID) { - getBuildingInstance().setSemanticID(semanticID); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } @@ -143,6 +144,28 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { return getSelf(); } + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } + /** * This function allows setting a value for category * @@ -155,57 +178,57 @@ public B category(String category) { } /** - * This function allows setting a value for description + * This function allows setting a value for idShort * - * @param description desired value to be set - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for displayNames * - * @param description desired value to be added - * @return Builder object with new value for description + * @param displayNames desired value to be set + * @return Builder object with new value for displayNames */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B displayNames(List displayNames) { + getBuildingInstance().setDisplayNames(displayNames); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List displayNames * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param displayName desired value to be added + * @return Builder object with new value for displayNames */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayNames().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for descriptions * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param descriptions desired value to be set + * @return Builder object with new value for descriptions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B descriptions(List descriptions) { + getBuildingInstance().setDescriptions(descriptions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows adding a value to the List descriptions * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be added + * @return Builder object with new value for descriptions */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(LangStringTextType description) { + getBuildingInstance().getDescriptions().add(description); return getSelf(); } @@ -230,26 +253,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java index 3cc977501..524a25820 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java index a3589053e..bd24f1053 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,13 +35,13 @@ public B value(String value) { } /** - * This function allows setting a value for valueID + * This function allows setting a value for valueId * - * @param valueID desired value to be set - * @return Builder object with new value for valueID + * @param valueId desired value to be set + * @return Builder object with new value for valueId */ - public B valueID(Reference valueID) { - getBuildingInstance().setValueID(valueID); + public B valueId(Reference valueId) { + getBuildingInstance().setValueId(valueId); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index 236a00239..dd9bbe22e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -41,8 +42,8 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateID") - protected String templateID; + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + protected String templateId; @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") protected String version; @@ -50,16 +51,14 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() { - - } + public DefaultAdministrativeInformation() {} @Override public int hashCode() { - return Objects.hash(this.creator, + return Objects.hash(this.version, this.revision, - this.templateID, - this.version, + this.creator, + this.templateId, this.embeddedDataSpecifications); } @@ -73,22 +72,22 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.creator, other.creator) && + return Objects.equals(this.version, other.version) && Objects.equals(this.revision, other.revision) && - Objects.equals(this.templateID, other.templateID) && - Objects.equals(this.version, other.version) && + Objects.equals(this.creator, other.creator) && + Objects.equals(this.templateId, other.templateId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @Override - public Reference getCreator() { - return creator; + public String getVersion() { + return version; } @Override - public void setCreator(Reference creator) { - this.creator = creator; + public void setVersion(String version) { + this.version = version; } @Override @@ -102,23 +101,23 @@ public void setRevision(String revision) { } @Override - public String getTemplateID() { - return templateID; + public Reference getCreator() { + return creator; } @Override - public void setTemplateID(String templateID) { - this.templateID = templateID; + public void setCreator(Reference creator) { + this.creator = creator; } @Override - public String getVersion() { - return version; + public String getTemplateId() { + return templateId; } @Override - public void setVersion(String version) { - this.version = version; + public void setTemplateId(String templateId) { + this.templateId = templateId; } @Override @@ -131,6 +130,16 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } + public String toString() { + return String.format( + "DefaultAdministrativeInformation (" + "version=%s," + + "revision=%s," + + "creator=%s," + + "templateId=%s," + + ")", + this.version, this.revision, this.creator, this.templateId); + } + /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 722d4ab26..8a4f964a8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -43,8 +44,8 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -56,10 +57,10 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -70,9 +71,7 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() { - - } + public DefaultAnnotatedRelationshipElement() {} @Override public int hashCode() { @@ -80,14 +79,14 @@ public int hashCode() { this.first, this.second, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -104,14 +103,14 @@ public boolean equals(Object obj) { Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -156,13 +155,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -175,6 +174,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -186,33 +195,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -225,14 +234,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElement (" + "annotations=%s," + + ")", + this.annotations); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index f9d5a7d03..13bc5b590 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,21 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; + import java.util.ArrayList; import java.util.List; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; - /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell @@ -64,29 +58,28 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() { - } + public DefaultAssetAdministrationShell() {} @Override public int hashCode() { - return Objects.hash(this.assetInformation, - this.derivedFrom, + return Objects.hash(this.derivedFrom, + this.assetInformation, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions); } @@ -100,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.assetInformation, other.assetInformation) && - Objects.equals(this.derivedFrom, other.derivedFrom) && + return Objects.equals(this.derivedFrom, other.derivedFrom) && + Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override @@ -185,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -224,6 +217,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultAssetAdministrationShell (" + "derivedFrom=%s," + + "assetInformation=%s," + + "submodels=%s," + + ")", + this.derivedFrom, this.assetInformation, this.submodels); + } + /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index ade88005b..eaaeff408 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -17,7 +18,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -45,23 +46,21 @@ public class DefaultAssetInformation implements AssetInformation { @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetID") - protected String globalAssetID; + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() { - - } + public DefaultAssetInformation() {} @Override public int hashCode() { return Objects.hash(this.assetKind, + this.globalAssetId, + this.specificAssetIds, this.assetType, - this.defaultThumbnail, - this.globalAssetID, - this.specificAssetIds); + this.defaultThumbnail); } @Override @@ -75,10 +74,10 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.assetType, other.assetType) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && - Objects.equals(this.globalAssetID, other.globalAssetID) && - Objects.equals(this.specificAssetIds, other.specificAssetIds); + Objects.equals(this.defaultThumbnail, other.defaultThumbnail); } } @@ -93,43 +92,54 @@ public void setAssetKind(AssetKind assetKind) { } @Override - public String getAssetType() { - return assetType; + public String getGlobalAssetId() { + return globalAssetId; } @Override - public void setAssetType(String assetType) { - this.assetType = assetType; + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override - public String getGlobalAssetID() { - return globalAssetID; + public String getAssetType() { + return assetType; } @Override - public void setGlobalAssetID(String globalAssetID) { - this.globalAssetID = globalAssetID; + public void setAssetType(String assetType) { + this.assetType = assetType; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public Resource getDefaultThumbnail() { + return defaultThumbnail; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; + } + + public String toString() { + return String.format( + "DefaultAssetInformation (" + "assetKind=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + "assetType=%s," + + "defaultThumbnail=%s," + + ")", + this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 035a2c7b0..d7fda6b91 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -62,8 +63,8 @@ public class DefaultBasicEventElement implements BasicEventElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -75,37 +76,35 @@ public class DefaultBasicEventElement implements BasicEventElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() { - - } + public DefaultBasicEventElement() {} @Override public int hashCode() { - return Objects.hash(this.direction, - this.lastUpdate, - this.maxInterval, - this.messageBroker, + return Objects.hash(this.observed, + this.direction, + this.state, this.messageTopic, + this.messageBroker, + this.lastUpdate, this.minInterval, - this.observed, - this.state, + this.maxInterval, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -118,26 +117,36 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.direction, other.direction) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.maxInterval, other.maxInterval) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.observed, other.observed) && + Objects.equals(this.direction, other.direction) && + Objects.equals(this.state, other.state) && Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.lastUpdate, other.lastUpdate) && Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.observed, other.observed) && - Objects.equals(this.state, other.state) && + Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public Reference getObserved() { + return observed; + } + + @Override + public void setObserved(Reference observed) { + this.observed = observed; + } + @Override public Direction getDirection() { return direction; @@ -149,23 +158,23 @@ public void setDirection(Direction direction) { } @Override - public String getLastUpdate() { - return lastUpdate; + public StateOfEvent getState() { + return state; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setState(StateOfEvent state) { + this.state = state; } @Override - public String getMaxInterval() { - return maxInterval; + public String getMessageTopic() { + return messageTopic; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -179,13 +188,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getMessageTopic() { - return messageTopic; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override @@ -199,23 +208,13 @@ public void setMinInterval(String minInterval) { } @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - - @Override - public StateOfEvent getState() { - return state; + public String getMaxInterval() { + return maxInterval; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -229,13 +228,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -248,6 +247,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -259,33 +268,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -298,14 +307,19 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBasicEventElement (" + "observed=%s," + + "direction=%s," + + "state=%s," + + "messageTopic=%s," + + "messageBroker=%s," + + "lastUpdate=%s," + + "minInterval=%s," + + "maxInterval=%s," + + ")", + this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, + this.maxInterval); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index bcb565022..7bf8f2a70 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -46,8 +47,8 @@ public class DefaultBlob implements Blob { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -59,31 +60,29 @@ public class DefaultBlob implements Blob { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBlob() { - - } + public DefaultBlob() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - Arrays.hashCode(this.value), + return Objects.hash(Arrays.hashCode(this.value), + this.contentType, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -96,38 +95,38 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Objects.equals(this.contentType, other.contentType) && - Arrays.equals(this.value, other.value) && + return Arrays.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -141,13 +140,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -160,6 +159,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -171,33 +180,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -210,14 +219,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBlob (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 77c89e298..4f7a63e40 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultCapability implements Capability { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,29 +53,27 @@ public class DefaultCapability implements Capability { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultCapability() { - - } + public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -88,14 +87,14 @@ public boolean equals(Object obj) { } else { DefaultCapability other = (DefaultCapability) obj; return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -110,13 +109,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -129,6 +128,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -140,33 +149,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -179,14 +188,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } + public String toString() { + return String.format( + "DefaultCapability (" + + ")" - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + ); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 558778b24..62a5cb678 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -34,7 +35,7 @@ public class DefaultConceptDescription implements ConceptDescription { @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - protected List isCaseOf = new ArrayList<>(); + protected List isCaseOfs = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); @@ -52,28 +53,26 @@ public class DefaultConceptDescription implements ConceptDescription { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultConceptDescription() { - - } + public DefaultConceptDescription() {} @Override public int hashCode() { - return Objects.hash(this.isCaseOf, + return Objects.hash(this.isCaseOfs, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions); } @@ -87,26 +86,26 @@ public boolean equals(Object obj) { return false; } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; - return Objects.equals(this.isCaseOf, other.isCaseOf) && + return Objects.equals(this.isCaseOfs, other.isCaseOfs) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public List getIsCaseOf() { - return isCaseOf; + public List getIsCaseOfs() { + return isCaseOfs; } @Override - public void setIsCaseOf(List isCaseOf) { - this.isCaseOf = isCaseOf; + public void setIsCaseOfs(List isCaseOfs) { + this.isCaseOfs = isCaseOfs; } @Override @@ -150,33 +149,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -189,6 +188,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultConceptDescription (" + "isCaseOfs=%s," + + ")", + this.isCaseOfs); + } + /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 168d88f21..799f3cee9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -31,63 +32,61 @@ * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIEC61360") +@IRI("aas:DataSpecificationIec61360") public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/dataType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/definition") - protected List definition = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + protected List definitions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/preferredName") - protected List preferredName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + protected List preferredNames = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/shortName") - protected List shortName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + protected List shortNames = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/unitID") - protected Reference unitID; + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() { - - } + public DefaultDataSpecificationIec61360() {} @Override public int hashCode() { - return Objects.hash(this.dataType, - this.definition, - this.levelType, - this.preferredName, - this.shortName, + return Objects.hash(this.preferredNames, + this.shortNames, + this.unit, + this.unitId, this.sourceOfDefinition, this.symbol, - this.unit, - this.unitID, - this.value, + this.dataType, + this.definitions, this.valueFormat, - this.valueList); + this.valueList, + this.value, + this.levelType); } @Override @@ -100,69 +99,59 @@ public boolean equals(Object obj) { return false; } else { DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.levelType, other.levelType) && - Objects.equals(this.preferredName, other.preferredName) && - Objects.equals(this.shortName, other.shortName) && + return Objects.equals(this.preferredNames, other.preferredNames) && + Objects.equals(this.shortNames, other.shortNames) && + Objects.equals(this.unit, other.unit) && + Objects.equals(this.unitId, other.unitId) && Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && Objects.equals(this.symbol, other.symbol) && - Objects.equals(this.unit, other.unit) && - Objects.equals(this.unitID, other.unitID) && - Objects.equals(this.value, other.value) && + Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definitions, other.definitions) && Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList); + Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.value, other.value) && + Objects.equals(this.levelType, other.levelType); } } @Override - public DataTypeIec61360 getDataType() { - return dataType; - } - - @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; - } - - @Override - public List getDefinition() { - return definition; + public List getPreferredNames() { + return preferredNames; } @Override - public void setDefinition(List definition) { - this.definition = definition; + public void setPreferredNames(List preferredNames) { + this.preferredNames = preferredNames; } @Override - public LevelType getLevelType() { - return levelType; + public List getShortNames() { + return shortNames; } @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; + public void setShortNames(List shortNames) { + this.shortNames = shortNames; } @Override - public List getPreferredName() { - return preferredName; + public String getUnit() { + return unit; } @Override - public void setPreferredName(List preferredName) { - this.preferredName = preferredName; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getShortName() { - return shortName; + public Reference getUnitId() { + return unitId; } @Override - public void setShortName(List shortName) { - this.shortName = shortName; + public void setUnitId(Reference unitId) { + this.unitId = unitId; } @Override @@ -186,33 +175,23 @@ public void setSymbol(String symbol) { } @Override - public String getUnit() { - return unit; - } - - @Override - public void setUnit(String unit) { - this.unit = unit; - } - - @Override - public Reference getUnitID() { - return unitID; + public DataTypeIec61360 getDataType() { + return dataType; } @Override - public void setUnitID(Reference unitID) { - this.unitID = unitID; + public void setDataType(DataTypeIec61360 dataType) { + this.dataType = dataType; } @Override - public String getValue() { - return value; + public List getDefinitions() { + return definitions; } @Override - public void setValue(String value) { - this.value = value; + public void setDefinitions(List definitions) { + this.definitions = definitions; } @Override @@ -235,6 +214,45 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public LevelType getLevelType() { + return levelType; + } + + @Override + public void setLevelType(LevelType levelType) { + this.levelType = levelType; + } + + public String toString() { + return String.format( + "DefaultDataSpecificationIec61360 (" + "preferredNames=%s," + + "shortNames=%s," + + "unit=%s," + + "unitId=%s," + + "sourceOfDefinition=%s," + + "symbol=%s," + + "dataType=%s," + + "definitions=%s," + + "valueFormat=%s," + + "valueList=%s," + + "value=%s," + + "levelType=%s," + + ")", + this.preferredNames, this.shortNames, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, + this.definitions, this.valueFormat, this.valueList, this.value, this.levelType); + } + /** * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 4d3135579..093108949 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,9 +40,7 @@ public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecificati @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() { - - } + public DefaultEmbeddedDataSpecification() {} @Override public int hashCode() { @@ -84,6 +83,14 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } + public String toString() { + return String.format( + "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," + + "dataSpecificationContent=%s," + + ")", + this.dataSpecification, this.dataSpecificationContent); + } + /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index e3a75f9a8..f049cb13f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,11 +36,11 @@ public class DefaultEntity implements Entity { @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetID") - protected String globalAssetID; + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + protected List specificAssetIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Entity/statements") protected List statements = new ArrayList<>(); @@ -50,8 +51,8 @@ public class DefaultEntity implements Entity { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -63,33 +64,31 @@ public class DefaultEntity implements Entity { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultEntity() { - - } + public DefaultEntity() {} @Override public int hashCode() { - return Objects.hash(this.entityType, - this.globalAssetID, + return Objects.hash(this.statements, + this.entityType, + this.globalAssetId, this.specificAssetIds, - this.statements, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -102,60 +101,60 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.entityType, other.entityType) && - Objects.equals(this.globalAssetID, other.globalAssetID) && + return Objects.equals(this.statements, other.statements) && + Objects.equals(this.entityType, other.entityType) && + Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.statements, other.statements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public EntityType getEntityType() { - return entityType; + public List getStatements() { + return statements; } @Override - public void setEntityType(EntityType entityType) { - this.entityType = entityType; + public void setStatements(List statements) { + this.statements = statements; } @Override - public String getGlobalAssetID() { - return globalAssetID; + public EntityType getEntityType() { + return entityType; } @Override - public void setGlobalAssetID(String globalAssetID) { - this.globalAssetID = globalAssetID; + public void setEntityType(EntityType entityType) { + this.entityType = entityType; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public String getGlobalAssetId() { + return globalAssetId; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public List getStatements() { - return statements; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setStatements(List statements) { - this.statements = statements; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override @@ -169,13 +168,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -188,6 +187,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -199,33 +208,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -238,14 +247,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultEntity (" + "statements=%s," + + "entityType=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + ")", + this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index ae4b92b96..53367b728 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,15 +45,13 @@ public class DefaultEnvironment implements Environment { @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() { - - } + public DefaultEnvironment() {} @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.conceptDescriptions, - this.submodels); + this.submodels, + this.conceptDescriptions); } @Override @@ -66,8 +65,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && - Objects.equals(this.submodels, other.submodels); + Objects.equals(this.submodels, other.submodels) && + Objects.equals(this.conceptDescriptions, other.conceptDescriptions); } } @@ -82,23 +81,32 @@ public void setAssetAdministrationShells(List assetAdm } @Override - public List getConceptDescriptions() { - return conceptDescriptions; + public List getSubmodels() { + return submodels; } @Override - public void setConceptDescriptions(List conceptDescriptions) { - this.conceptDescriptions = conceptDescriptions; + public void setSubmodels(List submodels) { + this.submodels = submodels; } @Override - public List getSubmodels() { - return submodels; + public List getConceptDescriptions() { + return conceptDescriptions; } @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; + public void setConceptDescriptions(List conceptDescriptions) { + this.conceptDescriptions = conceptDescriptions; + } + + public String toString() { + return String.format( + "DefaultEnvironment (" + "assetAdministrationShells=%s," + + "submodels=%s," + + "conceptDescriptions=%s," + + ")", + this.assetAdministrationShells, this.submodels, this.conceptDescriptions); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index b775a8922..49453f922 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,8 +36,8 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticID") - protected Reference observableSemanticID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + protected Reference observableSemanticId; @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") protected byte[] payload; @@ -44,11 +45,11 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticID") - protected Reference sourceSemanticID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectID") - protected Reference subjectID; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + protected Reference subjectId; @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") protected String timeStamp; @@ -56,20 +57,18 @@ public class DefaultEventPayload implements EventPayload { @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") protected String topic; - public DefaultEventPayload() { - - } + public DefaultEventPayload() {} @Override public int hashCode() { - return Objects.hash(this.observableReference, - this.observableSemanticID, - Arrays.hashCode(this.payload), - this.source, - this.sourceSemanticID, - this.subjectID, + return Objects.hash(this.source, + this.sourceSemanticId, + this.observableReference, + this.observableSemanticId, + this.topic, + this.subjectId, this.timeStamp, - this.topic); + Arrays.hashCode(this.payload)); } @Override @@ -82,75 +81,75 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.observableReference, other.observableReference) && - Objects.equals(this.observableSemanticID, other.observableSemanticID) && - Arrays.equals(this.payload, other.payload) && - Objects.equals(this.source, other.source) && - Objects.equals(this.sourceSemanticID, other.sourceSemanticID) && - Objects.equals(this.subjectID, other.subjectID) && + return Objects.equals(this.source, other.source) && + Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && + Objects.equals(this.observableReference, other.observableReference) && + Objects.equals(this.observableSemanticId, other.observableSemanticId) && + Objects.equals(this.topic, other.topic) && + Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Objects.equals(this.topic, other.topic); + Arrays.equals(this.payload, other.payload); } } @Override - public Reference getObservableReference() { - return observableReference; + public Reference getSource() { + return source; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setSource(Reference source) { + this.source = source; } @Override - public Reference getObservableSemanticID() { - return observableSemanticID; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setObservableSemanticID(Reference observableSemanticID) { - this.observableSemanticID = observableSemanticID; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override - public byte[] getPayload() { - return payload; + public Reference getObservableReference() { + return observableReference; } @Override - public void setPayload(byte[] payload) { - this.payload = payload; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSource() { - return source; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getSourceSemanticID() { - return sourceSemanticID; + public String getTopic() { + return topic; } @Override - public void setSourceSemanticID(Reference sourceSemanticID) { - this.sourceSemanticID = sourceSemanticID; + public void setTopic(String topic) { + this.topic = topic; } @Override - public Reference getSubjectID() { - return subjectID; + public Reference getSubjectId() { + return subjectId; } @Override - public void setSubjectID(Reference subjectID) { - this.subjectID = subjectID; + public void setSubjectId(Reference subjectId) { + this.subjectId = subjectId; } @Override @@ -164,13 +163,28 @@ public void setTimeStamp(String timeStamp) { } @Override - public String getTopic() { - return topic; + public byte[] getPayload() { + return payload; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setPayload(byte[] payload) { + this.payload = payload; + } + + public String toString() { + return String.format( + "DefaultEventPayload (" + "source=%s," + + "sourceSemanticId=%s," + + "observableReference=%s," + + "observableSemanticId=%s," + + "topic=%s," + + "subjectId=%s," + + "timeStamp=%s," + + "payload=%s," + + ")", + this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, + this.timeStamp, this.payload); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index 7f0212ad5..60f3a99bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -38,31 +39,29 @@ public class DefaultExtension implements Extension { protected String name; @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - protected List refersTo = new ArrayList<>(); + protected List refersTos = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Extension/value") protected String value; @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - - } + public DefaultExtension() {} @Override public int hashCode() { return Objects.hash(this.name, - this.refersTo, - this.value, this.valueType, - this.semanticID, + this.value, + this.refersTos, + this.semanticId, this.supplementalSemanticIds); } @@ -77,10 +76,10 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.refersTo, other.refersTo) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.value, other.value) && + Objects.equals(this.refersTos, other.refersTos) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } @@ -96,13 +95,13 @@ public void setName(String name) { } @Override - public List getRefersTo() { - return refersTo; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTo(List refersTo) { - this.refersTo = refersTo; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -116,23 +115,23 @@ public void setValue(String value) { } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public List getRefersTos() { + return refersTos; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setRefersTos(List refersTos) { + this.refersTos = refersTos; } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -145,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultExtension (" + "name=%s," + + "valueType=%s," + + "value=%s," + + "refersTos=%s," + + ")", + this.name, this.valueType, this.value, this.refersTos); + } + /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 146fed567..908dbfbb0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -44,8 +45,8 @@ public class DefaultFile implements File { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -57,31 +58,29 @@ public class DefaultFile implements File { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultFile() { - - } + public DefaultFile() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.value, + return Objects.hash(this.value, + this.contentType, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -94,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -139,13 +138,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -158,6 +157,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -169,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -208,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultFile (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index d098f2840..a5be28afe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,9 +38,7 @@ public class DefaultKey implements Key { @IRI("https://admin-shell.io/aas/3/0/Key/value") protected String value; - public DefaultKey() { - - } + public DefaultKey() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setValue(String value) { this.value = value; } + public String toString() { + return String.format( + "DefaultKey (" + "type=%s," + + "value=%s," + + ")", + this.type, this.value); + } + /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index ed0a94c2f..da15bb1e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringDefinitionTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 1023 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringDefinitionTypeIEC61360") +@IRI("aas:LangStringDefinitionTypeIec61360") public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefinitionTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefini @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringDefinitionTypeIec61360() { - - } + public DefaultLangStringDefinitionTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringDefinitionTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringDefinitionTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index 1d165b23d..39f6e1fe3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -36,9 +37,7 @@ public class DefaultLangStringNameType implements LangStringNameType { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringNameType() { - - } + public DefaultLangStringNameType() {} @Override public int hashCode() { @@ -81,6 +80,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringNameType (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringNameType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 6e60307a3..8e62a44e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringPreferredNameTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 255 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringPreferredNameTypeIEC61360") +@IRI("aas:LangStringPreferredNameTypeIec61360") public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPreferredNameTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPre @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringPreferredNameTypeIec61360() { - - } + public DefaultLangStringPreferredNameTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringPreferredNameTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringPreferredNameTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index adf213af1..9b718f90e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,11 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringShortNameTypeIec61360Builder; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; /** @@ -28,7 +29,7 @@ * String with length 18 maximum and minimum 1 characters and with language tags */ -@IRI("aas:LangStringShortNameTypeIEC61360") +@IRI("aas:LangStringShortNameTypeIec61360") public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNameTypeIec61360 { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/language") @@ -37,9 +38,7 @@ public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNa @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringShortNameTypeIec61360() { - - } + public DefaultLangStringShortNameTypeIec61360() {} @Override public int hashCode() { @@ -82,6 +81,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringShortNameTypeIec61360 (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringShortNameTypeIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index 90c243c77..ef6a0b75a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -36,9 +37,7 @@ public class DefaultLangStringTextType implements LangStringTextType { @IRI("https://admin-shell.io/aas/3/0/AbstractLangString/text") protected String text; - public DefaultLangStringTextType() { - - } + public DefaultLangStringTextType() {} @Override public int hashCode() { @@ -81,6 +80,14 @@ public void setText(String text) { this.text = text; } + public String toString() { + return String.format( + "DefaultLangStringTextType (" + + ")" + + ); + } + /** * This builder class can be used to construct a DefaultLangStringTextType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 5251649b3..667fa1098 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -43,16 +44,14 @@ public class DefaultLevelType implements LevelType { @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") protected boolean typ; - public DefaultLevelType() { - - } + public DefaultLevelType() {} @Override public int hashCode() { - return Objects.hash(this.max, - this.min, + return Objects.hash(this.min, this.nom, - this.typ); + this.typ, + this.max); } @Override @@ -65,23 +64,13 @@ public boolean equals(Object obj) { return false; } else { DefaultLevelType other = (DefaultLevelType) obj; - return Objects.equals(this.max, other.max) && - Objects.equals(this.min, other.min) && + return Objects.equals(this.min, other.min) && Objects.equals(this.nom, other.nom) && - Objects.equals(this.typ, other.typ); + Objects.equals(this.typ, other.typ) && + Objects.equals(this.max, other.max); } } - @Override - public boolean getMax() { - return max; - } - - @Override - public void setMax(boolean max) { - this.max = max; - } - @Override public boolean getMin() { return min; @@ -112,6 +101,26 @@ public void setTyp(boolean typ) { this.typ = typ; } + @Override + public boolean getMax() { + return max; + } + + @Override + public void setMax(boolean max) { + this.max = max; + } + + public String toString() { + return String.format( + "DefaultLevelType (" + "min=%s," + + "nom=%s," + + "typ=%s," + + "max=%s," + + ")", + this.min, this.nom, this.typ, this.max); + } + /** * This builder class can be used to construct a DefaultLevelType bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 56f9cb8f7..27bf73690 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,17 +39,17 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - protected List value = new ArrayList<>(); + protected List values = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); @@ -57,31 +58,29 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() { - - } + public DefaultMultiLanguageProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, - this.valueID, + return Objects.hash(this.values, + this.valueId, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -94,38 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultMultiLanguageProperty other = (DefaultMultiLanguageProperty) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && + return Objects.equals(this.values, other.values) && + Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public List getValue() { - return value; + public List getValues() { + return values; } @Override - public void setValue(List value) { - this.value = value; + public void setValues(List values) { + this.values = values; } @Override - public Reference getValueID() { - return valueID; + public Reference getValueId() { + return valueId; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override @@ -139,13 +138,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -158,6 +157,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -169,33 +178,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -208,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultMultiLanguageProperty (" + "values=%s," + + "valueId=%s," + + ")", + this.values, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index 51f9b021d..b4f359f66 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultOperation implements Operation { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -60,32 +61,30 @@ public class DefaultOperation implements Operation { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultOperation() { - - } + public DefaultOperation() {} @Override public int hashCode() { - return Objects.hash(this.inoutputVariables, - this.inputVariables, + return Objects.hash(this.inputVariables, this.outputVariables, + this.inoutputVariables, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,31 +97,21 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inoutputVariables, other.inoutputVariables) && - Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && + Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getInputVariables() { return inputVariables; @@ -143,6 +132,16 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultOperation (" + "inputVariables=%s," + + "outputVariables=%s," + + "inoutputVariables=%s," + + ")", + this.inputVariables, this.outputVariables, this.inoutputVariables); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index 6ba755f0a..5d30e0263 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -66,6 +67,13 @@ public void setValue(SubmodelElement value) { this.value = value; } + public String toString() { + return String.format( + "DefaultOperationVariable (" + "value=%s," + + ")", + this.value); + } + /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 738f5723f..273ac55b9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultProperty implements Property { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -47,11 +48,11 @@ public class DefaultProperty implements Property { @IRI("https://admin-shell.io/aas/3/0/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Property/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); @@ -60,32 +61,30 @@ public class DefaultProperty implements Property { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultProperty() { - - } + public DefaultProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, - this.valueID, - this.valueType, + return Objects.hash(this.valueType, + this.value, + this.valueId, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,49 +97,49 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && - Objects.equals(this.valueType, other.valueType) && + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && + Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getValue() { - return value; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setValue(String value) { - this.value = value; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override - public Reference getValueID() { - return valueID; + public String getValue() { + return value; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValue(String value) { + this.value = value; } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public Reference getValueId() { + return valueId; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultProperty (" + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.valueType, this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index fc1d46bb3..2bb2a7182 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -14,7 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXSD; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -36,8 +37,8 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -51,24 +52,22 @@ public class DefaultQualifier implements Qualifier { @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + protected Reference valueId; @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; - public DefaultQualifier() { - - } + public DefaultQualifier() {} @Override public int hashCode() { return Objects.hash(this.kind, this.type, - this.value, - this.valueID, this.valueType, - this.semanticID, + this.value, + this.valueId, + this.semanticId, this.supplementalSemanticIds); } @@ -84,10 +83,10 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && - Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID) && Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.value, other.value) && + Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } @@ -113,43 +112,43 @@ public void setType(String type) { } @Override - public String getValue() { - return value; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setValue(String value) { - this.value = value; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override - public Reference getValueID() { - return valueID; + public String getValue() { + return value; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValue(String value) { + this.value = value; } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public Reference getValueId() { + return valueId; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setValueId(Reference valueId) { + this.valueId = valueId; } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -162,6 +161,17 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultQualifier (" + "kind=%s," + + "type=%s," + + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.kind, this.type, this.valueType, this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 18710604c..1e80d3426 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultRange implements Range { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -54,38 +55,36 @@ public class DefaultRange implements Range { protected String min; @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - protected DataTypeDefXSD valueType; + protected DataTypeDefXsd valueType; @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultRange() { - - } + public DefaultRange() {} @Override public int hashCode() { - return Objects.hash(this.max, + return Objects.hash(this.valueType, this.min, - this.valueType, + this.max, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,29 +97,29 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.max, other.max) && + return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.min, other.min) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -134,13 +133,13 @@ public void setMin(String min) { } @Override - public DataTypeDefXSD getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXSD valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -154,13 +153,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -173,6 +172,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -184,33 +193,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -223,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRange (" + "valueType=%s," + + "min=%s," + + "max=%s," + + ")", + this.valueType, this.min, this.max); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index 3817f9236..79d0f7a68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,21 +38,19 @@ public class DefaultReference implements Reference { @IRI("https://admin-shell.io/aas/3/0/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticID") - protected Reference referredSemanticID; + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + protected Reference referredSemanticId; @IRI("https://admin-shell.io/aas/3/0/Reference/type") protected ReferenceTypes type; - public DefaultReference() { - - } + public DefaultReference() {} @Override public int hashCode() { - return Objects.hash(this.keys, - this.referredSemanticID, - this.type); + return Objects.hash(this.type, + this.referredSemanticId, + this.keys); } @Override @@ -64,40 +63,49 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.keys, other.keys) && - Objects.equals(this.referredSemanticID, other.referredSemanticID) && - Objects.equals(this.type, other.type); + return Objects.equals(this.type, other.type) && + Objects.equals(this.referredSemanticId, other.referredSemanticId) && + Objects.equals(this.keys, other.keys); } } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; + public void setType(ReferenceTypes type) { + this.type = type; } @Override - public Reference getReferredSemanticID() { - return referredSemanticID; + public Reference getReferredSemanticId() { + return referredSemanticId; } @Override - public void setReferredSemanticID(Reference referredSemanticID) { - this.referredSemanticID = referredSemanticID; + public void setReferredSemanticId(Reference referredSemanticId) { + this.referredSemanticId = referredSemanticId; } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; + } + + public String toString() { + return String.format( + "DefaultReference (" + "type=%s," + + "referredSemanticId=%s," + + "keys=%s," + + ")", + this.type, this.referredSemanticId, this.keys); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 3b36d2062..032121dd0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultReferenceElement implements ReferenceElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,10 +53,10 @@ public class DefaultReferenceElement implements ReferenceElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -63,22 +64,20 @@ public class DefaultReferenceElement implements ReferenceElement { @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() { - - } + public DefaultReferenceElement() {} @Override public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -93,14 +92,14 @@ public boolean equals(Object obj) { DefaultReferenceElement other = (DefaultReferenceElement) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -125,13 +124,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -144,6 +143,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -155,33 +164,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -194,14 +203,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultReferenceElement (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 99bd400e0..df41bf9e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -39,8 +40,8 @@ public class DefaultRelationshipElement implements RelationshipElement { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -52,10 +53,10 @@ public class DefaultRelationshipElement implements RelationshipElement { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -66,23 +67,21 @@ public class DefaultRelationshipElement implements RelationshipElement { @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() { - - } + public DefaultRelationshipElement() {} @Override public int hashCode() { return Objects.hash(this.first, this.second, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -98,14 +97,14 @@ public boolean equals(Object obj) { return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -140,13 +139,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -159,6 +158,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -170,33 +179,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -209,14 +218,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRelationshipElement (" + "first=%s," + + "second=%s," + + ")", + this.first, this.second); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index 44b40cb2b..fa28ac29e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -37,14 +38,12 @@ public class DefaultResource implements Resource { @IRI("https://admin-shell.io/aas/3/0/Resource/path") protected String path; - public DefaultResource() { - - } + public DefaultResource() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.path); + return Objects.hash(this.path, + this.contentType); } @Override @@ -57,29 +56,37 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.path, other.path); + return Objects.equals(this.path, other.path) && + Objects.equals(this.contentType, other.contentType); } } @Override - public String getContentType() { - return contentType; + public String getPath() { + return path; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setPath(String path) { + this.path = path; } @Override - public String getPath() { - return path; + public String getContentType() { + return contentType; } @Override - public void setPath(String path) { - this.path = path; + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String toString() { + return String.format( + "DefaultResource (" + "path=%s," + + "contentType=%s," + + ")", + this.path, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java deleted file mode 100644 index 5c35ffb9e..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetID.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SpecificAssetIDBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetID - * - * A specific asset ID describes a generic supplementary identifying attribute of the asset. - */ - -@IRI("aas:SpecificAssetID") -public class DefaultSpecificAssetID implements SpecificAssetID { - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/externalSubjectID") - protected Reference externalSubjectID; - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/name") - protected String name; - - @IRI("https://admin-shell.io/aas/3/0/SpecificAssetID/value") - protected String value; - - public DefaultSpecificAssetID() { - - } - - @Override - public int hashCode() { - return Objects.hash(this.externalSubjectID, - this.name, - this.value, - this.semanticID, - this.supplementalSemanticIds); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSpecificAssetID other = (DefaultSpecificAssetID) obj; - return Objects.equals(this.externalSubjectID, other.externalSubjectID) && - Objects.equals(this.name, other.name) && - Objects.equals(this.value, other.value) && - Objects.equals(this.semanticID, other.semanticID) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); - } - } - - @Override - public Reference getExternalSubjectID() { - return externalSubjectID; - } - - @Override - public void setExternalSubjectID(Reference externalSubjectID) { - this.externalSubjectID = externalSubjectID; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - @Override - public Reference getSemanticID() { - return semanticID; - } - - @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - /** - * This builder class can be used to construct a DefaultSpecificAssetID bean. - */ - public static class Builder extends SpecificAssetIDBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSpecificAssetID newBuildingInstance() { - return new DefaultSpecificAssetID(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 17f582dc9..5ae55c885 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -41,8 +42,8 @@ public class DefaultSubmodel implements Submodel { @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") protected ModellingKind kind; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -60,10 +61,10 @@ public class DefaultSubmodel implements Submodel { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -71,24 +72,22 @@ public class DefaultSubmodel implements Submodel { @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() { - - } + public DefaultSubmodel() {} @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, + this.kind, + this.semanticId, + this.supplementalSemanticIds, this.administration, this.id, this.category, - this.description, - this.displayName, this.idShort, + this.displayNames, + this.descriptions, this.extensions, - this.semanticID, - this.supplementalSemanticIds, - this.kind, this.qualifiers); } @@ -104,16 +103,16 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticID, other.semanticID) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -139,103 +138,103 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public AdministrativeInformation getAdministration() { - return administration; + public ModellingKind getKind() { + return kind; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setKind(ModellingKind kind) { + this.kind = kind; } @Override - public String getId() { - return id; + public Reference getSemanticId() { + return semanticId; } @Override - public void setId(String id) { - this.id = id; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public String getCategory() { - return category; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setCategory(String category) { - this.category = category; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public List getDescription() { - return description; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setDescription(List description) { - this.description = description; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public List getDisplayName() { - return displayName; + public String getId() { + return id; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setId(String id) { + this.id = id; } @Override - public String getIdShort() { - return idShort; + public String getCategory() { + return category; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setCategory(String category) { + this.category = category; } @Override - public List getExtensions() { - return extensions; + public String getIdShort() { + return idShort; } @Override - public void setExtensions(List extensions) { - this.extensions = extensions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public Reference getSemanticID() { - return semanticID; + public List getDisplayNames() { + return displayNames; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public List getDescriptions() { + return descriptions; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override - public ModellingKind getKind() { - return kind; + public List getExtensions() { + return extensions; } @Override - public void setKind(ModellingKind kind) { - this.kind = kind; + public void setExtensions(List extensions) { + this.extensions = extensions; } @Override @@ -248,6 +247,13 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } + public String toString() { + return String.format( + "DefaultSubmodel (" + "submodelElements=%s," + + ")", + this.submodelElements); + } + /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 2cb74847c..e321cce9a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -19,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Objects; @@ -41,8 +41,8 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -54,33 +54,31 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - protected Collection value = new ArrayList<>(); + protected List values = new ArrayList<>(); - public DefaultSubmodelElementCollection() { - - } + public DefaultSubmodelElementCollection() {} @Override public int hashCode() { - return Objects.hash(this.value, + return Objects.hash(this.values, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -93,27 +91,27 @@ public boolean equals(Object obj) { return false; } else { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; - return Objects.equals(this.value, other.value) && + return Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @Override - public Collection getValue() { - return value; + public List getValues() { + return values; } @Override - public void setValue(Collection value) { - this.value = value; + public void setValues(List values) { + this.values = values; } @Override @@ -127,13 +125,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -146,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -157,33 +165,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -196,14 +204,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementCollection (" + "values=%s," + + ")", + this.values); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 745f21e17..bf6140f48 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -38,8 +39,8 @@ public class DefaultSubmodelElementList implements SubmodelElementList { @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticID") - protected Reference semanticID; + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); @@ -51,10 +52,10 @@ public class DefaultSubmodelElementList implements SubmodelElementList { protected String category; @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); + protected List descriptions = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayNames = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; @@ -62,38 +63,36 @@ public class DefaultSubmodelElementList implements SubmodelElementList { @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIDListElement") - protected Reference semanticIDListElement; + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + protected Reference semanticIdListElement; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") - protected AASSubmodelElements typeValueListElement; + protected AasSubmodelElements typeValueListElement; @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - protected List value = new ArrayList<>(); + protected List values = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - protected DataTypeDefXSD valueTypeListElement; + protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() { - - } + public DefaultSubmodelElementList() {} @Override public int hashCode() { return Objects.hash(this.orderRelevant, - this.semanticIDListElement, + this.semanticIdListElement, this.typeValueListElement, - this.value, this.valueTypeListElement, + this.values, this.embeddedDataSpecifications, - this.semanticID, + this.semanticId, this.supplementalSemanticIds, + this.qualifiers, this.category, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayNames, + this.descriptions, + this.extensions); } @Override @@ -107,19 +106,19 @@ public boolean equals(Object obj) { } else { DefaultSubmodelElementList other = (DefaultSubmodelElementList) obj; return Objects.equals(this.orderRelevant, other.orderRelevant) && - Objects.equals(this.semanticIDListElement, other.semanticIDListElement) && + Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && + Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticID, other.semanticID) && + Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayNames, other.displayNames) && + Objects.equals(this.descriptions, other.descriptions) && + Objects.equals(this.extensions, other.extensions); } } @@ -134,43 +133,43 @@ public void setOrderRelevant(boolean orderRelevant) { } @Override - public Reference getSemanticIDListElement() { - return semanticIDListElement; + public Reference getSemanticIdListElement() { + return semanticIdListElement; } @Override - public void setSemanticIDListElement(Reference semanticIDListElement) { - this.semanticIDListElement = semanticIDListElement; + public void setSemanticIdListElement(Reference semanticIdListElement) { + this.semanticIdListElement = semanticIdListElement; } @Override - public AASSubmodelElements getTypeValueListElement() { + public AasSubmodelElements getTypeValueListElement() { return typeValueListElement; } @Override - public void setTypeValueListElement(AASSubmodelElements typeValueListElement) { + public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { this.typeValueListElement = typeValueListElement; } @Override - public List getValue() { - return value; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValue(List value) { - this.value = value; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override - public DataTypeDefXSD getValueTypeListElement() { - return valueTypeListElement; + public List getValues() { + return values; } @Override - public void setValueTypeListElement(DataTypeDefXSD valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValues(List values) { + this.values = values; } @Override @@ -184,13 +183,13 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public Reference getSemanticID() { - return semanticID; + public Reference getSemanticId() { + return semanticId; } @Override - public void setSemanticID(Reference semanticID) { - this.semanticID = semanticID; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override @@ -203,6 +202,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + @Override public String getCategory() { return category; @@ -214,33 +223,33 @@ public void setCategory(String category) { } @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override - public List getDisplayName() { - return displayName; + public List getDisplayNames() { + return displayNames; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayNames(List displayNames) { + this.displayNames = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescriptions() { + return descriptions; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescriptions(List descriptions) { + this.descriptions = descriptions; } @Override @@ -253,14 +262,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementList (" + "orderRelevant=%s," + + "semanticIdListElement=%s," + + "typeValueListElement=%s," + + "valueTypeListElement=%s," + + "values=%s," + + ")", + this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.values); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index a4c7d4236..be8669adf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -67,6 +68,13 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } + public String toString() { + return String.format( + "DefaultValueList (" + "valueReferencePairs=%s," + + ")", + this.valueReferencePairs); + } + /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index fbffa2f47..7464601a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,17 +36,15 @@ public class DefaultValueReferencePair implements ValueReferencePair { @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueID") - protected Reference valueID; + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + protected Reference valueId; - public DefaultValueReferencePair() { - - } + public DefaultValueReferencePair() {} @Override public int hashCode() { return Objects.hash(this.value, - this.valueID); + this.valueId); } @Override @@ -59,7 +58,7 @@ public boolean equals(Object obj) { } else { DefaultValueReferencePair other = (DefaultValueReferencePair) obj; return Objects.equals(this.value, other.value) && - Objects.equals(this.valueID, other.valueID); + Objects.equals(this.valueId, other.valueId); } } @@ -74,13 +73,21 @@ public void setValue(String value) { } @Override - public Reference getValueID() { - return valueID; + public Reference getValueId() { + return valueId; } @Override - public void setValueID(Reference valueID) { - this.valueID = valueID; + public void setValueId(Reference valueId) { + this.valueId = valueId; + } + + public String toString() { + return String.format( + "DefaultValueReferencePair (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); } /** From d868f19d1f841033c7c4fd3fcc7fc4a4a9bf90f8 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 27 Jun 2023 16:04:29 +0200 Subject: [PATCH 02/91] Update dataformat-aasx project --- .../v3/dataformat/aasx/AASXDeserializer.java | 26 +++---- .../v3/dataformat/aasx/AASXSerializer.java | 75 +++++++++++++------ .../deserialization/AASXDeserializerTest.java | 8 +- .../aasx/deserialization/ValidationTest.java | 16 ++-- .../serialization/AASXSerializerTest.java | 17 +++-- .../src/test/resources/jsonExample.json | 2 +- 6 files changed, 87 insertions(+), 57 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 5108b7bf9..0a3b4da65 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -33,7 +31,7 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -49,10 +47,8 @@ public class AASXDeserializer { private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final String AASX_ORIGIN = "/aasx/aasx-origin"; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - private final XmlDeserializer deserializer; + private XmlDeserializer deserializer = new XmlDeserializer(); private Environment environment; private final OPCPackage aasxRoot; @@ -66,7 +62,6 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); - this.deserializer = new XmlDeserializer(); } /** @@ -131,7 +126,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat // Read the content from the PackagePart InputStream stream = xmlPart.getInputStream(); StringWriter writer = new StringWriter(); - IOUtils.copy(stream, writer, DEFAULT_CHARSET); + IOUtils.copy(stream, writer, Serializer.DEFAULT_CHARSET); return writer.toString(); } @@ -139,7 +134,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat * Load the referenced filepaths in the submodels such as PDF, PNG files from * the package * - * @return a list of the folder name and folder path, the folder holds the files + * @return a map of the folder name and folder path, the folder holds the files * @throws IOException if creating input streams for aasx fails * @throws InvalidFormatException if aasx package format is invalid * @throws DeserializationException if deserialization of the serialized aas environment fails @@ -166,10 +161,15 @@ private List parseElements(Collection elements) { for (SubmodelElement element : elements) { if (element instanceof File) { File file = (File) element; - paths.add(file.getValue()); + // If the path contains a "://", we can assume, that the Path is a link to an + // other server + // e.g. http://localhost:8080/aasx/... + if (!file.getValue().contains("://")) { + paths.add(file.getValue()); + } } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValues())); + paths.addAll(parseElements(collection.getValue())); } } return paths; @@ -193,7 +193,7 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc } private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { - PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); + PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(filePath)); InputStream stream = part.getInputStream(); return new InMemoryFile(stream.readAllBytes(), filePath); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 449be54c3..050dce41e 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,6 @@ import java.io.IOException; import java.io.OutputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -33,20 +31,18 @@ import org.apache.poi.openxml4j.opc.RelationshipSource; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; - /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels @@ -66,15 +62,12 @@ public class AASXSerializer { private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - private final XmlSerializer xmlSerializer; + private Serializer xmlSerializer = new XmlSerializer(); /** * Default constructor */ public AASXSerializer() { - this.xmlSerializer = new XmlSerializer(); } /** @@ -82,7 +75,7 @@ public AASXSerializer() { * * @param xmlSerializer a custom serializer used for serializing the aas environment */ - public AASXSerializer(XmlSerializer xmlSerializer) { + public AASXSerializer(Serializer xmlSerializer) { this.xmlSerializer = xmlSerializer; } @@ -109,7 +102,7 @@ public void write(Environment environment, Collection files, Outpu String xml = xmlSerializer.write(environment); // Save the XML to aasx/xml/content.xml - PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); + PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(Serializer.DEFAULT_CHARSET)); storeFilesInAASX(environment.getSubmodels(), files, rootPackage, xmlPart); @@ -125,11 +118,11 @@ public void write(Environment environment, Collection files, Outpu * @param xmlPart the Part the files should be related to */ private void storeFilesInAASX(List submodelList, Collection files, OPCPackage rootPackage, - PackagePart xmlPart) { + PackagePart xmlPart) { for (Submodel sm : submodelList) { for (File file : findFileElements(sm.getSubmodelElements())) { - String filePath = AASXUtils.getPathFromURL(file.getValue()); + String filePath = file.getValue(); try { InMemoryFile content = findFileByPath(files, filePath); logger.trace("Writing file '" + filePath + "' to .aasx."); @@ -203,7 +196,7 @@ private PackagePart createAASXPart(OPCPackage root, RelationshipSource relateTo, * @param content the content to be written to the part */ private void writeDataToPart(PackagePart part, byte[] content) { - try (OutputStream ostream = part.getOutputStream()) { + try (OutputStream ostream = part.getOutputStream();) { ostream.write(content); ostream.flush(); } catch (Exception e) { @@ -226,7 +219,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); } } @@ -252,7 +245,7 @@ private void prepareFilePaths(Collection submodels) { */ private InMemoryFile findFileByPath(Collection files, String path) { for (InMemoryFile file : files) { - if (AASXUtils.getPathFromURL(file.getPath()).equals(path)) { + if (preparePath(file.getPath()).equals(path)) { return file; } } @@ -260,17 +253,51 @@ private InMemoryFile findFileByPath(Collection files, String path) } /** - * Removes the serverpart from a path and ensures it starts with "file://" + * Removes the serverpart from a path and ensures it starts with a slash * * @param path the path to be prepared * @return the prepared path */ private String preparePath(String path) { - String newPath = AASXUtils.getPathFromURL(path); - if (!newPath.startsWith("file://")) { - newPath = "file://" + newPath; + String newPath = getPathFromURL(path); + if (!newPath.startsWith("/")) { + newPath = "/" + newPath; } return newPath; } + /** + * Gets the path from a URL e.g "http://localhost:8080/path/to/test.file" + * results in "/path/to/test.file" + * + * @param url + * @return the path from the URL + */ + private String getPathFromURL(String url) { + if (url == null) { + return null; + } + + if (url.contains("://")) { + + // Find the ":" and and remove the "http://" from the url + int index = url.indexOf(":") + 3; + url = url.substring(index); + + // Find the first "/" from the URL (now without the "http://") and remove + // everything before that + index = url.indexOf("/"); + url = url.substring(index); + + // Recursive call to deal with more than one server parts + // (e.g. basyx://127.0.0.1:6998//https://localhost/test/) + return getPathFromURL(url); + } else { + // Make sure the path has a / at the start + if (!url.startsWith("/")) { + url = "/" + url; + } + return url; + } + } } \ No newline at end of file diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 77425197e..465f8b8be 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,20 +48,19 @@ public class AASXDeserializerTest { @Test public void testRoundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { - List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXDeserializer deserializer = new AASXDeserializer(in); - assertEquals(AASSimple.createEnvironment(), deserializer.read()); + assertEquals(AASSimple.ENVIRONMENT, deserializer.read()); assertEquals(fileList, deserializer.getRelatedFiles()); } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index 6b1622c43..5fe63adfb 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,17 +30,18 @@ import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.xml.sax.SAXException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; + public class ValidationTest { @Rule @@ -49,12 +51,12 @@ public class ValidationTest { public void validateXmlInsideAasx() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXValidator v = new AASXValidator(in); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index cfce0d5c1..f3830bb2c 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,15 +41,15 @@ public class AASXSerializerTest { - private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; - private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; + private static final String XML_PATH = "aasx/xml/content.xml"; + private static final String ORIGIN_PATH = "aasx/aasx-origin"; private List fileList = new ArrayList<>(); @Before public void setup() throws IOException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile file = new InMemoryFile(operationManualContent, "aasx/OperatingManual.pdf"); fileList.add(file); } @@ -61,7 +62,7 @@ public void testBuildAASX() throws IOException, TransformerException, ParserConf // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); + new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, out); validateAASX(out); } @@ -73,7 +74,7 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { ArrayList filePaths = new ArrayList<>(); while ((zipEntry = in.getNextEntry()) != null) { - if (zipEntry.getName().equals(XML_PATH_URI)) { + if (zipEntry.getName().equals(XML_PATH)) { // Read the first 5 bytes of the XML file to make sure it is in fact XML file // No further test of XML file necessary as XML-Converter is tested separately @@ -84,11 +85,11 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { } // Write the paths of all files contained in the .aasx into filePaths - filePaths.add("file:///" + zipEntry.getName()); + filePaths.add(zipEntry.getName()); } - assertTrue(filePaths.contains(XML_PATH_URI)); - assertTrue(filePaths.contains(ORIGIN_PATH_URI)); + assertTrue(filePaths.contains(XML_PATH)); + assertTrue(filePaths.contains(ORIGIN_PATH)); // Check if all expected files are present // Needs to strip the first slash of the paths, as ZipEntry gives paths without diff --git a/dataformat-aasx/src/test/resources/jsonExample.json b/dataformat-aasx/src/test/resources/jsonExample.json index f6421ef44..26cd27970 100644 --- a/dataformat-aasx/src/test/resources/jsonExample.json +++ b/dataformat-aasx/src/test/resources/jsonExample.json @@ -192,7 +192,7 @@ }, "idShort": "DigitalFile_PDF", "mimeType": "application/pdf", - "value": "file:///aasx/OperatingManual.pdf" + "value": "/aasx/OperatingManual.pdf" } ] } From f339157ae8e09b8569098c371cffc3ca0977390e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 27 Jun 2023 16:27:25 +0200 Subject: [PATCH 03/91] Update dataformat-core --- .../core/DataSpecificationInfo.java | 48 +++++++++++++++++++ .../aas4j/v3/model/TypedProperty.java | 2 + 2 files changed, 50 insertions(+) create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java new file mode 100644 index 000000000..784b2d8e7 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +/** + * Class representing all information required for a (custom) data specification + */ +public class DataSpecificationInfo { + + private final Class type; + private final Reference reference; + private final String prefix; + + public DataSpecificationInfo(Class type, Reference reference, String prefix) { + this.type = type; + this.reference = reference; + this.prefix = prefix; + } + + public Class getType() { + return type; + } + + public Reference getReference() { + return reference; + } + + public String getPrefix() { + return prefix; + } +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java index dc5eed87f..748aa4bf9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java @@ -15,6 +15,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.model; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; + public interface TypedProperty extends Property { } From c62e54d8680c41c74602748462aa5956be12d540 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 08:47:16 +0200 Subject: [PATCH 04/91] Update dataformat-core project --- .../dataformat/DeserializationException.java | 2 +- .../aas4j/v3/dataformat/Deserializer.java | 129 +++ .../v3/dataformat/SerializationException.java | 2 +- .../aas4j/v3/dataformat/Serializer.java | 119 +++ .../core/DataSpecificationManager.java | 108 +++ .../v3/dataformat/core/ReflectionHelper.java | 434 +++++++++ ...EmbeddedDataSpecificationDeserializer.java | 69 ++ .../deserialization/EnumDeserializer.java | 29 +- .../EmbeddedDataSpecificationSerializer.java | 85 ++ .../core/serialization/EnumSerializer.java | 68 +- .../v3/dataformat/core/util/AasUtils.java | 452 +++++++--- .../core/util/IdentifiableCollector.java | 69 ++ .../util/MostSpecificClassComparator.java | 36 + .../util/MostSpecificTypeTokenComparator.java | 37 + ...ssetAdministrationShellElementVisitor.java | 268 ++++++ ...ministrationShellElementWalkerVisitor.java | 271 ++++++ .../aas4j/v3/dataformat/mapping/Mapper.java | 27 + .../v3/dataformat/mapping/MappingContext.java | 40 + .../dataformat/mapping/MappingException.java | 32 + .../dataformat/mapping/MappingProvider.java | 136 +++ .../dataformat/mapping/SourceBasedMapper.java | 38 + .../dataformat/mapping/TargetBasedMapper.java | 38 + .../aas4j/v3/dataformat/core/AASFull.java | 840 +++++++++--------- .../aas4j/v3/dataformat/core/AASSimple.java | 185 ++-- .../v3/dataformat/core/AasUtilsTest.java | 52 ++ .../v3/dataformat/core/CustomProperty.java | 47 +- .../dataformat/core/EnumDeserializerTest.java | 72 +- .../dataformat/core/EnumSerializerTest.java | 73 +- 28 files changed, 2951 insertions(+), 807 deletions(-) create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java index 26e0f1868..f201050f7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; -@SuppressWarnings("serial") public class DeserializationException extends Exception { public DeserializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java new file mode 100644 index 000000000..fd5b0826c --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; + +/** + * Generic deserializer interface to deserialize a given string, Outputstream or + * java.io.File into an instance of AssetAdministrationShellEnvironment + */ +public interface Deserializer { + + /** + * Default charset that will be used when no charset is specified + */ + Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + Environment read(String value) throws DeserializationException; + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + default Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + default Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + default Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + default Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ + void useImplementation(Class aasInterface, Class implementation); + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java index 981d657cb..00ccc1b95 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; -@SuppressWarnings("serial") public class SerializationException extends Exception { public SerializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java new file mode 100644 index 000000000..ef6fdbfb8 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat; + +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; + +/** + * Generic serializer interface to serialize an instance of + * AssetAdministrationShellEnvironment to a string, Outputstream or java.io.File + */ +public interface Serializer { + + /** + * Default charset that will be used when no charset is specified + */ + Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ + String write(Environment aasEnvironment) throws SerializationException; + + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + default void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); + } + + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + default void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); + } + } + + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + default void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); + } + } + + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + default void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java new file mode 100644 index 000000000..0db3ae12a --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import java.util.Arrays; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import java.util.HashSet; +import java.util.Set; +import java.util.function.Predicate; + +/** + * This class is used to manage supported data specification templates. Each + * template is identified through a reference and a prefix and provides a + * corresponding Java class. + */ +public class DataSpecificationManager { + + public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; + public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; + public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"; + public static final String DATA_SPECIFICATION_IEC61360_PREFIX = "IEC"; + + private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( + // new DataSpecificationInfo(DataSpecificationIEC61360.class, + // createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), + // DATA_SPECIFICATION_IEC61360_PREFIX) + )); + + /** + * Allows to register an additional data specification template + * + * @param dataSpecification Details of the data specification template to + * register + */ + public static void register(DataSpecificationInfo dataSpecification) { + KNOWN_IMPLEMENTATIONS.add(dataSpecification); + } + + private static Reference createGlobalIri(String iri) { + return new DefaultReference.Builder().keys(Arrays.asList( + new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value(iri).build())) + .build(); + } + + /** + * Returns a DataSpecificationInfo describing the data specification + * template implemented by the given class. If the class is unknown, null is + * returned. + * + * @param implementation type of the implementation class + * @return a DataSpecificationInfo describing the data specification + * template represented by the given class, or null if the implementation + * class does not represent any data specification + */ + public static DataSpecificationInfo getDataSpecification(Class implementation) { + DataSpecificationInfo result = getDataSpecification(x -> Objects.equals(x.getType(), implementation)); + if (result == null) { + result = getDataSpecification(x -> x.getType().isAssignableFrom(implementation)); + } + return result; + } + + /** + * Returns a DataSpecificationInfo describing the data specification + * template implemented by the given class. If the class is unknown, null is + * returned. + * + * @param reference Reference associated with the wanted data specficiation + * @return a DataSpecificationInfo describing the data specification + * template represented by the reference, or null if the reference does not + * represent any data specification + */ + public static DataSpecificationInfo getDataSpecification(Reference reference) { + return getDataSpecification(x -> AasUtils.sameAs(x.getReference(), reference)); + } + + private static DataSpecificationInfo getDataSpecification(Predicate filter) { + Optional exactMatch = KNOWN_IMPLEMENTATIONS.stream() + .filter(filter) + .findFirst(); + if (exactMatch.isPresent()) { + return exactMatch.get(); + } + return null; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java new file mode 100644 index 000000000..a88291966 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java @@ -0,0 +1,434 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.commons.lang3.ClassUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfo; +import io.github.classgraph.ClassInfoList; +import io.github.classgraph.ScanResult; + +/** + * Helper class to collect relevant data needed for + * ReflectionAnnotationIntrospector via reflection. + */ +public class ReflectionHelper { + + private static final Logger logger = LoggerFactory.getLogger(ReflectionHelper.class); + private static final String ROOT_PACKAGE_NAME = "org.eclipse.digitaltwin.aas4j.v3"; + /** + * Name of package where the generated model classes are defined + */ + public static final String MODEL_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".model"; + /** + * Name of package where the generated default implementation files are + * defined + */ + public static final String DEFAULT_IMPLEMENTATION_PACKAGE_NAME = MODEL_PACKAGE_NAME + ".impl"; + /** + * Name of package where the json mixins are defined. These mixins are + * automatically added to JsonSerializer and JsonDeserializer. + */ + public static final String JSON_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.json.mixins"; + /** + * Name of package where the xml mixins are defined. These mixins are + * automatically added to XmlSerializer and XmlDeserializer. + */ + public static final String XML_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.xml.mixins"; + /** + * Suffix that identifies a class as a mixin. + */ + public static final String MIXIN_SUFFIX = "Mixin"; + /** + * Prefix that defines a class as a default implementation + */ + public static final String DEFAULT_IMPLEMENTATION_PREFIX = "Default"; + /** + * Distinct root superclasses of which classify a class to include type + * information via the modelType property + */ + public static final Set> MODEL_TYPE_SUPERCLASSES = Set.of(Referable.class, DataSpecificationContent.class); + /** + * Expanded list of all classes that shall be annotated with the modelType + * property. + */ + public static final Set> TYPES_WITH_MODEL_TYPE; + /** + * Map of all interfaces and their subinterfaces defined in the + * MODEL_PACKAGE_NAME package. + */ + public static final Map, Set>> SUBTYPES; + /** + * List of all interfaces classes defined by the AAS. + */ + public static final Set INTERFACES; + /** + * Expanded list of all mixin classes defined in the + * JSON_MIXINS_PACKAGE_NAME package together with the corresponding class + * they should be applied to. + */ + public static final Map, Class> JSON_MIXINS; + /** + * Expanded list of all mixin classes defined in the XML_MIXINS_PACKAGE_NAME + * package together with the corresponding class they should be applied to. + */ + public static final Map, Class> XML_MIXINS; + /** + * Expanded list of all default implementations in the + * DEFAULT_IMPLEMENTATION_PACKAGE_NAME package together with the interface + * from the MODEL_PACKAGE_NAME package they are implementing. + */ + public static final List DEFAULT_IMPLEMENTATIONS; + /** + * List of interfaces from the MODEL_PACKAGE_NAME package that are known to + * not have any default implementation and therefore are excluded + * explicitely. + */ + public static final Set> INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION; + /** + * List of enums from the MODEL_PACKAGE_NAME package. + */ + public static final List> ENUMS; + + public static class ImplementationInfo { + + private final Class interfaceType; + private final Class implementationType; + + protected ImplementationInfo(Class interfaceType, Class implementationType) { + this.interfaceType = interfaceType; + this.implementationType = implementationType; + } + + public Class getInterfaceType() { + return interfaceType; + } + + public Class getImplementationType() { + return implementationType; + } + } + + /** + * Returns whether the given class is an interface and from within the + * MODEL_PACKAGE_NAME package + * + * @param type the class to check + * @return whether the given class is an interface and from within the + * MODEL_PACKAGE_NAME package + */ + public static boolean isModelInterface(Class type) { + return type.isInterface() && MODEL_PACKAGE_NAME.equals(type.getPackageName()); + } + + /** + * Returns whether the given class is a default implementation or not + * + * @param type the class to check + * @return whether the given class is a default implementation or not + */ + public static boolean isDefaultImplementation(Class type) { + return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> Objects.equals(x.getImplementationType(), type)); + } + + /** + * Returns whether the given interface has a default implementation or not + * + * @param interfaceType the interface to check + * @return whether the given interface has a default implementation or not + */ + public static boolean hasDefaultImplementation(Class interfaceType) { + return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> x.getInterfaceType().equals(interfaceType)); + } + + /** + * Returns the default implementation for an aas interface or null if the + * class is no aas interface or does not have default implementation + * + * @param interfaceType the interface to check + * @return the default implementation type for given interfaceType or null + * if the class is no aas interface or does not have default implementation + */ + public static Class getDefaultImplementation(Class interfaceType) { + if (isDefaultImplementation(interfaceType)) { + return interfaceType; + } + if (hasDefaultImplementation(interfaceType)) { + return DEFAULT_IMPLEMENTATIONS.stream() + .filter(x -> x.getInterfaceType().equals(interfaceType)) + .findFirst().get() + .getImplementationType(); + } + return null; + } + + /** + * Returns whether the given class is an interface from within the + * MODEL_PACKAGE_NAME package as well as a default implementation or not + * + * @param type the class to check + * @return whether the given class is an interface from within the + * MODEL_PACKAGE_NAME package as well as a default implementation or not + */ + public static boolean isModelInterfaceOrDefaultImplementation(Class type) { + return isModelInterface(type) || isDefaultImplementation(type); + } + + public static Class getAasInterface(Class type) { + Set> implementedAasInterfaces = getAasInterfaces(type); + if (implementedAasInterfaces.isEmpty()) { + return null; + } + if (implementedAasInterfaces.size() == 1) { + return implementedAasInterfaces.iterator().next(); + } + logger.warn("class '{}' implements more than one AAS interface, but only most specific one is returned", type.getName()); + return implementedAasInterfaces.stream().map(x -> TypeToken.of(x)) + .sorted(new MostSpecificTypeTokenComparator()) + .findFirst().get() + .getRawType(); + } + + public static Set> getAasInterfaces(Class type) { + Set> result = new HashSet<>(); + if (type != null) { + if (INTERFACES.contains(type)) { + result.add(type); + } + result.addAll(ClassUtils.getAllInterfaces(type).stream().filter(x -> INTERFACES.contains(x)).collect(Collectors.toSet())); + } + return result; + } + + /** + * Returns the AAS type information used for de-/serialization for a given + * class or null if type information should not be included + * + * @param clazz the class to find the type information for + * @return the type information for the given class or null if there is no + * type information or type information should not be included + */ + public static String getModelType(Class clazz) { + Class type = getMostSpecificTypeWithModelType(clazz); + if (type != null) { + return type.getSimpleName(); + } + for (Class interfaceClass : clazz.getInterfaces()) { + String result = getModelType(interfaceClass); + if (result != null) { + return result; + } + } + Class superClass = clazz.getSuperclass(); + if (superClass != null) { + return getModelType(superClass); + } + return null; + } + + /** + * Returns the most specific supertype that contains some AAS type + * information or null if there is none + * + * @param clazz the class to find the type for + * @return the most specific supertype of given class that contains some AAS + * type information or null if there is none + */ + public static Class getMostSpecificTypeWithModelType(Class clazz) { + if (clazz == null) { + return null; + } + return TYPES_WITH_MODEL_TYPE.stream() + .filter(x -> clazz.isInterface() ? x.equals(clazz) : x.isAssignableFrom(clazz)) + .sorted((Class o1, Class o2) -> { + // -1: o1 more special than o2 + // 0: o1 equals o2 or on same samelevel + // 1: o2 more special than o1 + if (o1.isAssignableFrom(o2)) { + if (o2.isAssignableFrom(o1)) { + return 0; + } + return 1; + } + if (o2.isAssignableFrom(o1)) { + return -1; + } + return 0; + }) + .findFirst() + .orElse(null); + } + + static { + ScanResult modelScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(MODEL_PACKAGE_NAME) + .scan(); + TYPES_WITH_MODEL_TYPE = scanModelTypes(modelScan); + SUBTYPES = scanSubtypes(modelScan); + JSON_MIXINS = scanMixins(modelScan, JSON_MIXINS_PACKAGE_NAME); + XML_MIXINS = scanMixins(modelScan, XML_MIXINS_PACKAGE_NAME); + DEFAULT_IMPLEMENTATIONS = scanDefaultImplementations(modelScan); + INTERFACES = scanAasInterfaces(); + ENUMS = modelScan.getAllEnums().loadClasses(Enum.class); + INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION = getInterfacesWithoutDefaultImplementation(modelScan); + } + + private static Set> getInterfacesWithoutDefaultImplementation(ScanResult modelScan) { + return modelScan.getAllInterfaces().loadClasses().stream() + .filter(x -> !hasDefaultImplementation(x)) + .collect(Collectors.toSet()); + } + + public static Set> getSuperTypes(Class clazz, boolean recursive) { + Set> result = SUBTYPES.entrySet().stream() + .filter(x -> x.getValue().contains(clazz)) + .map(x -> x.getKey()) + .collect(Collectors.toSet()); + if (recursive) { + result.addAll(result.stream() + .flatMap(x -> getSuperTypes(x, true).stream()) + .collect(Collectors.toSet())); + } + return result; + } + + private static List scanDefaultImplementations(ScanResult modelScan) { + ScanResult defaulImplementationScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(DEFAULT_IMPLEMENTATION_PACKAGE_NAME) + .scan(); + List defaultImplementations = new ArrayList<>(); + defaulImplementationScan.getAllClasses() + .filter(x -> x.getSimpleName().startsWith(DEFAULT_IMPLEMENTATION_PREFIX)) + .loadClasses() + .stream() + .forEach(x -> { + String interfaceName = x.getSimpleName().substring(DEFAULT_IMPLEMENTATION_PREFIX.length());// using conventions + ClassInfoList interfaceClassInfos = modelScan.getAllClasses().filter(y -> y.isInterface() && Objects.equals(y.getSimpleName(), interfaceName)); + if (interfaceClassInfos.isEmpty()) { + logger.warn("could not find interface realized by default implementation class '{}'", x.getSimpleName()); + } else { + Class implementedClass = interfaceClassInfos.get(0).loadClass(); + defaultImplementations.add(new ImplementationInfo(implementedClass, x)); + logger.debug("using default implementation class '{}' for interface '{}'", + x.getSimpleName(), + interfaceClassInfos.get(0).getName()); + + } + }); + return defaultImplementations; + } + + private static Set scanAasInterfaces() { + return DEFAULT_IMPLEMENTATIONS.stream().map(x -> x.interfaceType).collect(Collectors.toSet()); + } + + private static Map, Class> scanMixins(ScanResult modelScan, String packageName) { + ScanResult mixinScan = new ClassGraph() + .enableClassInfo() + .acceptPackagesNonRecursive(packageName) + .scan(); + Map, Class> mixins = new HashMap<>(); + mixinScan.getAllClasses() + .filter(x -> x.getSimpleName().endsWith(MIXIN_SUFFIX)) + .loadClasses() + .forEach(x -> { + String modelClassName = x.getSimpleName().substring(0, x.getSimpleName().length() - MIXIN_SUFFIX.length()); + ClassInfoList modelClassInfos = modelScan.getAllClasses().filter(y -> Objects.equals(y.getSimpleName(), modelClassName)); + if (modelClassInfos.isEmpty()) { + logger.warn("could not auto-resolve target class for mixin '{}'", x.getSimpleName()); + } else { + mixins.put(modelClassInfos.get(0).loadClass(), x); + logger.debug("using mixin '{}' for class '{}'", + x.getSimpleName(), + modelClassInfos.get(0).getName()); + } + }); + return mixins; + } + + private static Map, Set>> scanSubtypes(ScanResult modelScan) { + return modelScan.getAllInterfaces().stream() + .filter(ReflectionHelper::hasSubclass) + .collect(Collectors.toMap(ClassInfo::loadClass, ReflectionHelper::getSubclasses)); + } + + private static Set> getSubclasses(ClassInfo clazzInfo) { + return clazzInfo.getClassesImplementing() + .directOnly() + .filter(ClassInfo::isInterface) + .loadClasses() + .stream() + .collect(Collectors.toSet()); + } + + private static boolean hasSubclass(ClassInfo clazzInfo) { + return !getSubclasses(clazzInfo).isEmpty(); + } + + private static Set> scanModelTypes(ScanResult modelScan) { + Set> typesWithModelTypes; + typesWithModelTypes = MODEL_TYPE_SUPERCLASSES.stream() + .flatMap(x -> modelScan.getClassesImplementing(x.getName()).loadClasses().stream()) + .collect(Collectors.toSet()); + typesWithModelTypes.addAll(MODEL_TYPE_SUPERCLASSES); + return typesWithModelTypes; + } + + private ReflectionHelper() { + } + + /** + * Overrides empty list fields with null + * @param element + */ + public static void setEmptyListsToNull(Object element) { + + Field[] fields = element.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + field.setAccessible(true); + try { + if (field.getType().isAssignableFrom(List.class) && field.get(element)!=null && ((List) field.get(element)).isEmpty()) { + field.set(element, null); + } + } catch (IllegalAccessException e) { + // do nothing + } + field.setAccessible(false); + } + + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java new file mode 100644 index 000000000..64f8d4a15 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization; + +// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; +// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.impl.DefaultEmbeddedDataSpecification; + +// TODO: Update handling of embeddedDataSpecifications +// Currently we expect the following format +// +// "embeddedDataSpecifications": [ +// "embeddedDataSpecifications": {...}, // reference indicating the type +// "dataSpecificationContent": {...} // actual data specification +// ] +// +// In the future, either embeddedDataSpecifications or dataSpecificationContent should be present. +// However, it is still undefined how the actual (sub-)type of dataSpecificationContent should be serialized, so this cannot be implemented right now. +// Therefore, this functionality is currently disabled until standardization progresses. + +/** + * Custom Deserializer for class DataSpecification. First reads property + * PROP_DATA_SPECIFICATION and tries to resolve which Java class to use for + * deserialization based on the found value with the help of + * DataSpecificationManager. + */ +/* public class EmbeddedDataSpecificationDeserializer extends JsonDeserializer { + + @Override + public EmbeddedDataSpecification deserialize(JsonParser parser, DeserializationContext context) + throws IOException, JsonProcessingException { + Object temp = parser.getCodec().readTree(parser); + ObjectNode node = (ObjectNode) temp; + if (node == null) { + return null; + } + JsonNode nodeDataSpecification = node.get(PROP_DATA_SPECIFICATION); + if (nodeDataSpecification == null) { + throw new JsonMappingException(parser, + String.format("data specification must contain node '%s'", PROP_DATA_SPECIFICATION)); + } + JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeDataSpecification); + parserReference.nextToken(); + Reference reference = parserReference.readValueAs(Reference.class); + JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); + if (nodeContent != null) { + Class targetClass = DataSpecificationManager.getDataSpecification(reference).getType(); + JsonParser parserContent = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeContent); + parserContent.nextToken(); + DataSpecificationContent content = parserContent.readValueAs(targetClass); + return new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(content).build(); + } + return new DefaultEmbeddedDataSpecification.Builder().dataSpecification(reference).build(); + } +} +*/ \ No newline at end of file diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index 76ba4040b..b087fab00 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +22,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; /** * Deserializes enum values converting element names from UpperCamelCase to @@ -28,7 +30,7 @@ * * @param Type of enum to deserialize */ -public class EnumDeserializer> extends JsonDeserializer { +public class EnumDeserializer extends JsonDeserializer { protected final Class type; @@ -46,30 +48,7 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I value = value.substring(0, 1).toUpperCase() + value.substring(1); } - return Enum.valueOf(type, deserializeEnumName(value)); + return (T) Enum.valueOf(type, AasUtils.deserializeEnumName(value)); } - /** - * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE - * - * @param input - * input name in CamelCase - * @return name in SCREAMING_SNAKE_CASE - */ - public static String deserializeEnumName(String input) { - String result = ""; - if (input == null || input.isEmpty()) { - return result; - } - result += Character.toUpperCase(input.charAt(0)); - for (int i = 1; i < input.length(); i++) { - char currentChar = input.charAt(i), previousChar = input.charAt(i - 1); - if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { - result += "_"; - } - result += Character.toUpperCase(currentChar); - } - return result; - } - } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java new file mode 100644 index 000000000..3fd5b8c4a --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization; + +// TODO: import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; + + +/** + * Custom Serializer for class DataSpecification. Adds type information in form + * of a reference. Uses DataSpecificationManager to resolve java type to + * reference. + */ + +// TODO: Solve the problem with EmbeddedDataSpecifications +/*public class EmbeddedDataSpecificationSerializer extends JsonSerializer { + + private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); + + @Override + public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider) + throws IOException { + if (data == null) { + return; + } + Reference reference = null; + DataSpecificationContent content = data.getDataSpecificationContent(); + if (content != null) { + DataSpecificationInfo implicitDataSpecification = DataSpecificationManager.getDataSpecification(content.getClass()); + Reference implicitType = implicitDataSpecification != null ? implicitDataSpecification.getReference() : null; + Reference explicitType = data.getDataSpecification(); + if (implicitType == null) { + logger.warn( + "Trying to serialize unknown implementation of DataSpecificationContent ({}). " + + "Use DataSpecificationManager.register(Reference reference, Class implementation) " + + "to register your implementation", + content.getClass()); + if (explicitType == null) { + logger.warn("Missing type information for DataSpecificationContent! Will be serialized without type information."); + } else { + reference = explicitType; + } + } else { + reference = implicitType; + if (explicitType != null && !Objects.equals(implicitType, explicitType)) { + logger.warn("Conflicting type information for DataSpecificationContent (implicit type: {}, explicit type: {}). Explicit type will be used.", + implicitType, explicitType); + reference = explicitType; + } + } + } + if (reference != null || content != null) { + generator.writeStartObject(); + } + if (reference != null) { + generator.writeObjectField(PROP_DATA_SPECIFICATION, reference); + } + if (content != null) { + generator.writeObjectField(PROP_DATA_SPECIFICATION_CONTENT, content); + } + if (reference != null || content != null) { + generator.writeEndObject(); + } + } + + @Override + public void serializeWithType(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) + throws IOException, JsonProcessingException { + serialize(data, generator, provider); + } + +}*/ diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index bc015d93e..c0f3631a5 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,81 +18,45 @@ import java.io.IOException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; /** * Serializes enum values. If enum is part of the AAS Java model, the name will * be converted from SCREAMING_SNAKE_CASE to UpperCamelCase, else default * serialization will be used */ -@SuppressWarnings("rawtypes") public class EnumSerializer extends JsonSerializer { - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + protected static final char UNDERSCORE = '_'; + + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { - gen.writeString("xs:nonNegativeInteger"); - } else if(isTimeRelatedValue(value)) { - handleTimeRelatedValue(gen, value); + gen.writeString("xs:NonNegativeInteger"); } else { // pattern: 'xs:' + camelCase - String enum_string = serializeEnumName(value.name()); + String enum_string = AasUtils.serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIec61360) { - gen.writeString(value.name().toUpperCase()); - } else if (value instanceof Direction || value instanceof StateOfEvent) { - gen.writeString(value.name().toLowerCase()); + } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { + gen.writeString(value.name()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { - gen.writeString(serializeEnumName(value.name())); + gen.writeString(AasUtils.serializeEnumName(value.name())); } else { provider.findValueSerializer(Enum.class).serialize(value, gen, provider); } } - private void handleTimeRelatedValue(JsonGenerator gen, Enum value) throws IOException { - String enum_string = serializeEnumName(value.name()); - String adaptedEnumString = "xs:g" + enum_string.substring(1, 2).toUpperCase() + enum_string.substring(2); - gen.writeString(adaptedEnumString); - } - - private boolean isTimeRelatedValue(Enum value) { - String enum_string = serializeEnumName(value.name()); - return enum_string.startsWith("G"); - } - - /** - * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase - * - * @param input - * input name in SCREAMING_SNAKE_CASE - * @return name in CamelCase - */ - public static String serializeEnumName(String input) { - String result = ""; - boolean capitalize = true; - for (int i = 0; i < input.length(); i++) { - char currentChar = input.charAt(i); - if ('_' == currentChar) { - capitalize = true; - } else { - result += capitalize ? currentChar : Character.toLowerCase(currentChar); - capitalize = false; - } - } - return result; - } - } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 46985b03e..cd3b04514 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,38 +16,24 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; +import java.lang.reflect.Type; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Operation; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.reflect.TypeToken; - /** * Provides utility functions related to AAS */ @@ -55,29 +41,176 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final String REFERENCE_ELEMENT_DELIMITER = ", "; + private static final char UNDERSCORE = '_'; + private static final String KEY_REGEX_GROUP_TYPE = "type"; + private static final String KEY_REGEX_GROUP_ID_TYPE = "idtype"; + private static final String KEY_REGEX_GROUP_VALUE = "value"; + private static final Pattern KEY_REGEX = Pattern.compile( + String.format("\\((?<%s>\\w+)\\)\\[(?<%s>\\w+)\\](?<%s>.*)", + KEY_REGEX_GROUP_TYPE, + KEY_REGEX_GROUP_ID_TYPE, + KEY_REGEX_GROUP_VALUE)); private AasUtils() { } - /** - * Formats a Reference as string - * - * @param reference - * Reference to serialize - * @return string representation of the reference for serialization, null if - * reference is null - */ - private static String asString(Reference reference) { - if (reference == null) { - return null; - } - return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); - } + /** + * Formats a Reference as string + * + * @param reference Reference to serialize + * @return string representation of the reference for serialization, null if + * reference is null + */ + public static String asString(Reference reference) { + if (reference == null) { + return null; + } + return reference.getKeys().stream() + .map(x -> String.format("(%s)[%s]%s", + serializeEnumName(x.getType().name()), + x.getValue())) + .collect(Collectors.joining(",")); + } + + /** + * Parses a given string as Reference. If the given string is not a valid + * reference, null is returned. + * + * @param value String representation of the reference + * @return parsed Reference or null is given value is not a valid Reference + */ + public static Reference parseReference(String value) { + return parseReference(value, + ReflectionHelper.getDefaultImplementation(Reference.class), + ReflectionHelper.getDefaultImplementation(Key.class)); + } + + /** + * Parses a given string as Reference using the provided implementation of + * Reference and Key interface. If the given string is not a valid + * reference, null is returned. + * + * @param value String representation of the reference + * @param referenceType implementation type of Reference interface + * @param keyType implementation type of Key interface + * @return parsed Reference or null is given value is not a valid Reference + */ + public static Reference parseReference(String value, Class referenceType, Class keyType) { + if (value == null || value.isBlank()) { + return null; + } + try { + Reference result = referenceType.getConstructor().newInstance(); + result.setKeys(Stream.of(value.split(",")).map(x -> parseKey(x)).collect(Collectors.toList())); + // TODO: ReferenceType is ignored + // result.setType(Stream.of(value.split(",")).map(x -> parseReferenceType(x)).collect(Collectors.toList())); + return result; + } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new IllegalArgumentException("error parsing reference - could not instantiate reference type", ex); + } + } + + /** + * Gets property with given name as defined in type of given parent or null + * if not defined + * + * @param parent parent object + * @param propertyName name of the property + * @return property with given name as defined in type of given parent or + * null if not defined + */ + public static PropertyDescriptor getProperty(Object parent, String propertyName) { + if (parent == null || propertyName == null || propertyName.isBlank()) { + return null; + } + return getAasProperties(parent.getClass()).stream() + .filter(x -> x.getName().equals(propertyName)) + .findAny() + .orElse(null); + } + + /** + * Gets the content type of a generic collection type + * + * @param genericCollectionType the generic collection type + * @return the content type of the generic collection type + */ + public static Class getCollectionContentType(Type genericCollectionType) { + return TypeToken.of(genericCollectionType).resolveType(Collection.class.getTypeParameters()[0]).getRawType(); + } + + /** + * Gets property with given name as defined in given type or null if not + * defined + * + * @param type type containing the property + * @param propertyName name of the property + * @return property with given name as defined in given type or null if not + * defined + */ + public static PropertyDescriptor getProperty(Class type, String propertyName) { + if (type == null || propertyName == null || propertyName.isBlank()) { + return null; + } + return getAasProperties(type).stream() + .filter(x -> x.getName().equals(propertyName)) + .findAny() + .orElse(null); + } + + /** + * Parses a given string as Key. If the given string is not a valid key, + * null is returned. + * + * @param value String representation of the key + * @return parsed Key or null is given value is not a valid Key + */ + public static Key parseKey(String value) { + Matcher matcher = KEY_REGEX.matcher(value); + if (matcher.find()) { + KeyTypes keyType = KeyTypes.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_ID_TYPE))); + return new DefaultKey.Builder() + .type(keyType) + .value(matcher.group(KEY_REGEX_GROUP_VALUE)) + .build(); + } + return null; + } /** - * Creates a reference for an Identifiable instance using provided implementation types for reference and key + * Checks if a reference is a local reference or not. This functionality may + * not be 100% correct as since v3.0RC01 of the AAS specification there no + * longer is an isLocal property to check this and no alternative way to + * determine whether a reference is local or not is introduced. This method + * only checks for the presence of any Key with type GLOBAL_REFERENCE. + * Another approach would be to actually try resolving the reference + * locally. + * + * @param reference The reference to check + * @param environment The environment context the reference resides. In + * current implementation this is not used + * @return true if the reference is a local reference to the given + * environment, false otherwise + */ + public static boolean isLocal(Reference reference, Environment environment) { + return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyTypes.GLOBAL_REFERENCE); + } + + public static List getSubmodelTemplates(AssetAdministrationShell aas, Environment environment) { + return aas.getSubmodels().stream() + .map(ref -> resolve(ref, environment, Submodel.class)) + .filter(sm -> sm != null) + .filter(sm -> sm.getKind() != ModelingKind.INSTANCE) + .collect(Collectors.toList()); + } + + public static boolean hasTemplate(AssetAdministrationShell aas, Environment environment) { + return !getSubmodelTemplates(aas, environment).isEmpty(); + } + + /** + * Creates a reference for an Identifiable instance using provided + * implementation types for reference and key * * @param identifiable the identifiable to create the reference for * @param referenceType implementation type of Reference interface @@ -87,7 +220,6 @@ private static String asString(Reference reference) { public static Reference toReference(Identifiable identifiable, Class referenceType, Class keyType) { try { Reference reference = referenceType.getConstructor().newInstance(); - reference.setType(ReferenceTypes.MODEL_REFERENCE); Key key = keyType.getConstructor().newInstance(); key.setType(referableToKeyType(identifiable)); key.setValue(identifiable.getId()); @@ -112,44 +244,93 @@ public static Reference toReference(Identifiable identifiable) { * Gets the KeyElements type matching the provided Referable * * @param referable The referable to convert to KeyElements type - * @return the most specific KeyElements type representing the Referable, i.e. abstract types like SUBMODEL_ELEMENT - * or DATA_ELEMENT are never returned; null if there is no corresponding KeyElements type + * @return the most specific KeyElements type representing the Referable, + * i.e. abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT are never + * returned; null if there is no corresponding KeyElements type */ public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(deserializeEnumName(aasInterface.getSimpleName())); } return null; } + /** + * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase + * + * @param input input name in SCREAMING_SNAKE_CASE + * @return name in CamelCase + */ + public static String serializeEnumName(String input) { + String result = ""; + boolean capitalize = true; + for (int i = 0; i < input.length(); i++) { + char currentChar = input.charAt(i); + if (UNDERSCORE == currentChar) { + capitalize = true; + } else { + result += capitalize + ? currentChar + : Character.toLowerCase(currentChar); + capitalize = false; + } + } + return result; + } + + /** + * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE + * + * @param input input name in CamelCase + * @return name in SCREAMING_SNAKE_CASE + */ + public static String deserializeEnumName(String input) { + String result = ""; + if (input == null || input.isEmpty()) { + return result; + } + result += Character.toUpperCase(input.charAt(0)); + for (int i = 1; i < input.length(); i++) { + char currentChar = input.charAt(i), + previousChar = input.charAt(i - 1); + if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { + result += UNDERSCORE; + } + result += Character.toUpperCase(currentChar); + } + return result; + } + /** * Gets a Java interface representing the type provided by key. * * @param key The KeyElements type - * @return a Java interface representing the provided KeyElements type or null if no matching Class/interface could - * be found. It also returns abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT + * @return a Java interface representing the provided KeyElements type or + * null if no matching Class/interface could be found. It also returns + * abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT */ - private static Class keyTypeToClass(KeyTypes key) { + public static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(serializeEnumName(key.name()))) .findAny() .orElse(null); } /** - * Creates a reference for an element given a potential parent using provided implementation types for reference and - * key + * Creates a reference for an element given a potential parent using + * provided implementation types for reference and key * - * @param parent Reference to the parent. Can only be null when element is instance of Identifiable, otherwise - * result will always be null + * @param parent Reference to the parent. Can only be null when element is + * instance of Identifiable, otherwise result will always be null * @param element the element to create a reference for * @param referenceType implementation type of Reference interface * @param keyType implementation type of Key interface * - * @return A reference representing the element or null if either element is null or parent is null and element not - * an instance of Identifiable. In case element is an instance of Identifiable, the returned reference will only - * contain one key pointing directly to the element. + * @return A reference representing the element or null if either element is + * null or parent is null and element not an instance of Identifiable. In + * case element is an instance of Identifiable, the returned reference will + * only contain one key pointing directly to the element. */ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { if (element == null) { @@ -175,12 +356,13 @@ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { + public static Reference clone(Reference reference, Class referenceType, Class keyType) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } try { Reference result = referenceType.getConstructor().newInstance(); List newKeys = new ArrayList<>(); - result.setType(reference.getType()); for (Key key : reference.getKeys()) { Key newKey = keyType.getConstructor().newInstance(); newKey.setType(key.getType()); @@ -256,13 +449,15 @@ private static Reference clone(Reference reference, Class r } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, - * null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and + * returns the targeted object if available, null otherwise * * * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the reference against - * @return returns an instance of T if the reference could successfully be resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the + * reference against + * @return returns an instance of T if the reference could successfully be + * resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ public static Referable resolve(Reference reference, Environment env) { @@ -270,18 +465,21 @@ public static Referable resolve(Reference reference, Environment env) { } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, - * null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and + * returns the targeted object if available, null otherwise * - * @param sub-type of Referable of the targeted type. If unknown use Referable.class + * @param sub-type of Referable of the targeted type. If unknown use + * Referable.class * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the reference against - * @param type desired return type, use Referable.class is unknwon/not needed - * @return returns an instance of T if the reference could successfully be resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the + * reference against + * @param type desired return type, use Referable.class is unknwon/not + * needed + * @return returns an instance of T if the reference could successfully be + * resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ - @SuppressWarnings("unchecked") - public static T resolve(Reference reference, Environment env, Class type) { + public static T resolve(Reference reference, Environment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -330,54 +528,42 @@ public static T resolve(Reference reference, Environment e Key key = reference.getKeys().get(i); Class keyType = keyTypeToClass(key.getType()); if (keyType != null) { - if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { - try { - current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); - } catch (NumberFormatException ex) { - throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", - i, key.getValue())); - } catch (IndexOutOfBoundsException ex) { - throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", - i, - ((SubmodelElementList) current).getValues().size(), - key.getValue())); - } + Collection collection; + // operation needs special handling because of nested values + if (Operation.class.isAssignableFrom(current.getClass())) { + Operation operation = (Operation) current; + + collection = Stream.of(operation.getInputVariables().stream(), + operation.getOutputVariables().stream(), + operation.getInoutputVariables().stream()) + .flatMap(x -> x.map(y -> y.getValue())) + .collect(Collectors.toSet()); } else { - Collection collection; - if (Operation.class.isAssignableFrom(current.getClass())) { - Operation operation = (Operation) current; - collection = Stream.of(operation.getInputVariables().stream(), - operation.getOutputVariables().stream(), - operation.getInoutputVariables().stream()) - .flatMap(x -> x.map(y -> y.getValue())) - .collect(Collectors.toSet()); - } else { - List matchingProperties = getAasProperties(current.getClass()).stream() - .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) - .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) - .resolveType(Collection.class.getTypeParameters()[0]) - .isSupertypeOf(keyType)) - .collect(Collectors.toList()); - if (matchingProperties.isEmpty()) { - throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", - keyType.getSimpleName(), - current.getClass().getSimpleName())); - } - if (matchingProperties.size() > 1) { - throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", - matchingProperties.size(), - current.getClass().getSimpleName(), - matchingProperties.stream() - .map(x -> x.getName()) - .collect(Collectors.joining(", ")))); - } - try { - collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new IllegalArgumentException("error resolving reference", ex); - } + List matchingProperties = getAasProperties(current.getClass()).stream() + .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) + .resolveType(Collection.class.getTypeParameters()[0]) + .isSupertypeOf(keyType)) + .collect(Collectors.toList()); + if (matchingProperties.isEmpty()) { + throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", + keyType.getSimpleName(), + current.getClass().getSimpleName())); + } + if (matchingProperties.size() > 1) { + throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", + matchingProperties.size(), + current.getClass().getSimpleName(), + matchingProperties.stream() + .map(x -> x.getName()) + .collect(Collectors.joining(", ")))); + } + try { + collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); + } catch (Exception ex) { + throw new IllegalArgumentException("error resolving reference", ex); } - Optional next = collection.stream() + Optional next = collection.stream() .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) .findFirst(); if (next.isEmpty()) { @@ -391,14 +577,16 @@ public static T resolve(Reference reference, Environment e } /** - * Gets a list of all properties defined for a class implementing at least one AAS interface. + * Gets a list of all properties defined for a class implementing at least + * one AAS interface. * - * @param type A class implementing at least one AAS interface. If it is does not implement any AAS interface the - * result will be an empty list - * @return a list of all properties defined in any of AAS interface implemented by type. If type does not implement - * any AAS interface an empty list is returned. + * @param type A class implementing at least one AAS interface. If it is + * does not implement any AAS interface the result will be an empty list + * @return a list of all properties defined in any of AAS interface + * implemented by type. If type does not implement any AAS interface an + * empty list is returned. */ - private static List getAasProperties(Class type) { + public static List getAasProperties(Class type) { Class aasType = ReflectionHelper.getAasInterface(type); if (aasType == null) { aasType = ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream() @@ -425,4 +613,4 @@ private static List getAasProperties(Class type) { .sorted(Comparator.comparing(x -> x.getName())) .collect(Collectors.toList()); } -} \ No newline at end of file +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java new file mode 100644 index 000000000..78d0f7df0 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +import java.util.HashSet; +import java.util.Set; + +/** + * Collects all Identifiable elements within an + * AssetAdministrationShellEnvironment + */ +public class IdentifiableCollector { + + private Environment env; + + public IdentifiableCollector(Environment env) { + this.env = env; + } + + public Set collect() { + Visitor visitor = new Visitor(); + visitor.visit(env); + return visitor.identifiables; + } + + private class Visitor implements AssetAdministrationShellElementWalkerVisitor { + + Set identifiables = new HashSet<>(); + + @Override + public void visit(AssetAdministrationShell value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + + @Override + public void visit(Submodel value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + + @Override + public void visit(ConceptDescription value) { + identifiables.add(value); + AssetAdministrationShellElementWalkerVisitor.super.visit(value); + } + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java new file mode 100644 index 000000000..5c9805de7 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import java.util.Comparator; + +/** + * Comparator comparing two classes regarding which type is more specific. + */ +public class MostSpecificClassComparator implements Comparator> { + + @Override + public int compare(Class x, Class y) { + if (y.isAssignableFrom(x)) { + if (x.isAssignableFrom(y)) { + return 0; + } + return -1; + } + return 1; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java new file mode 100644 index 000000000..5915e8867 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; + +import com.google.common.reflect.TypeToken; +import java.util.Comparator; + +/** + * Comparator comparing two TypeToken regarding which type is more specific. + */ +public class MostSpecificTypeTokenComparator implements Comparator { + + @Override + public int compare(TypeToken x, TypeToken y) { + if (x.isSubtypeOf(y)) { + if (y.isSubtypeOf(x)) { + return 0; + } + return -1; + } + return 1; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java new file mode 100644 index 000000000..fc6f2af60 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + + +public interface AssetAdministrationShellElementVisitor { + + + public default void visit(DataElement dataElement) { + if (dataElement == null) { + return; + } + Class type = dataElement.getClass(); + if (Property.class.isAssignableFrom(type)) { + visit((Property) dataElement); + } else if (MultiLanguageProperty.class.isAssignableFrom(type)) { + visit((MultiLanguageProperty) dataElement); + } else if (Range.class.isAssignableFrom(type)) { + visit((Range) dataElement); + } else if (ReferenceElement.class.isAssignableFrom(type)) { + visit((ReferenceElement) dataElement); + } else if (File.class.isAssignableFrom(type)) { + visit((File) dataElement); + } else if (Blob.class.isAssignableFrom(type)) { + visit((Blob) dataElement); + } + } + + public default void visit(DataSpecificationContent dataSpecificationContent) { + if (dataSpecificationContent == null) { + return; + } + Class type = dataSpecificationContent.getClass(); + // if (DataSpecificationIEC61360.class.isAssignableFrom(type)) { + // visit((DataSpecificationIEC61360) dataSpecificationContent); + //} + } + + public default void visit(EventElement event) { + if (event == null) { + return; + } + Class type = event.getClass(); + if (BasicEventElement.class.isAssignableFrom(type)) { + visit((BasicEventElement) event); + } + } + + public default void visit(HasDataSpecification hasDataSpecification) { + if (hasDataSpecification == null) { + return; + } + Class type = hasDataSpecification.getClass(); + if (AssetAdministrationShell.class.isAssignableFrom(type)) { + visit((AssetAdministrationShell) hasDataSpecification); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasDataSpecification); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasDataSpecification); + } + + } + + public default void visit(HasExtensions hasExtensions) { + if (hasExtensions == null) { + return; + } + Class type = hasExtensions.getClass(); + if (Referable.class.isAssignableFrom(type)) { + visit((Referable) hasExtensions); + } + } + + public default void visit(HasKind hasKind) { + if (hasKind == null) { + return; + } + Class type = hasKind.getClass(); + if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasKind); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasKind); + } + } + + public default void visit(HasSemantics hasSemantics) { + if (hasSemantics == null) { + return; + } + Class type = hasSemantics.getClass(); + if (Extension.class.isAssignableFrom(type)) { + visit((Extension) hasSemantics); + } else if (SpecificAssetId.class.isAssignableFrom(type)) { + visit((SpecificAssetId) hasSemantics); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) hasSemantics); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) hasSemantics); + } else if (Qualifier.class.isAssignableFrom(type)) { + visit((Qualifier) hasSemantics); + } + } + + public default void visit(Identifiable identifiable) { + if (identifiable == null) { + return; + } + Class type = identifiable.getClass(); + if (AssetAdministrationShell.class.isAssignableFrom(type)) { + visit((AssetAdministrationShell) identifiable); + } else if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) identifiable); + } else if (ConceptDescription.class.isAssignableFrom(type)) { + visit((ConceptDescription) identifiable); + } + } + + public default void visit(SubmodelElement submodelElement) { + if (submodelElement == null) { + return; + } + Class type = submodelElement.getClass(); + if (RelationshipElement.class.isAssignableFrom(type)) { + visit((RelationshipElement) submodelElement); + } else if (DataElement.class.isAssignableFrom(type)) { + visit((DataElement) submodelElement); + } else if (Capability.class.isAssignableFrom(type)) { + visit((Capability) submodelElement); + } else if (SubmodelElementCollection.class.isAssignableFrom(type)) { + visit((SubmodelElementCollection) submodelElement); + } else if (Operation.class.isAssignableFrom(type)) { + visit((Operation) submodelElement); + } else if (EventElement.class.isAssignableFrom(type)) { + visit((EventElement) submodelElement); + } else if (Entity.class.isAssignableFrom(type)) { + visit((Entity) submodelElement); + } + } + + public default void visit(Qualifiable qualifiable) { + if (qualifiable == null) { + return; + } + Class type = qualifiable.getClass(); + if (Submodel.class.isAssignableFrom(type)) { + visit((Submodel) qualifiable); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) qualifiable); + } + } + + public default void visit(Referable referable) { + if (referable == null) { + return; + } + Class type = referable.getClass(); + if (Identifiable.class.isAssignableFrom(type)) { + visit((Identifiable) referable); + } else if (SubmodelElement.class.isAssignableFrom(type)) { + visit((SubmodelElement) referable); + } + } + + public default void visit(Environment assetAdministrationShellEnvironment) { + } + + public default void visit(AdministrativeInformation administrativeInformation) { + } + + public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { + } + + public default void visit(AssetAdministrationShell assetAdministrationShell) { + } + + public default void visit(AssetInformation assetInformation) { + } + + public default void visit(BasicEventElement basicEvent) { + } + + public default void visit(Blob blob) { + } + + public default void visit(Capability capability) { + } + + public default void visit(ConceptDescription conceptDescription) { + } + + //public default void visit(EmbeddedDataSpecification embeddedDataSpecification) { + //} + + public default void visit(Entity entity) { + } + public default void visit(EventPayload eventMessage) { + } + + public default void visit(Extension extension) { + } + + public default void visit(File file) { + } + + public default void visit(SpecificAssetId identifierKeyValuePair) { + } + + public default void visit(Key key) { + } + + public default void visit(LangString langString) { + } + + public default void visit(MultiLanguageProperty multiLanguageProperty) { + } + + public default void visit(Operation operation) { + } + + public default void visit(OperationVariable operationVariable) { + } + + public default void visit(Property property) { + } + + public default void visit(Qualifier qualifier) { + } + + public default void visit(Range range) { + } + + public default void visit(Reference reference) { + } + + public default void visit(ReferenceElement referenceElement) { + } + + public default void visit(RelationshipElement relationshipElement) { + } + + public default void visit(Submodel submodel) { + } + + public default void visit(SubmodelElementCollection submodelElementCollection) { + } + + public default void visit(Resource resource) { + + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java new file mode 100644 index 000000000..9a1e53ad1 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { + + + @Override + public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { + if (annotatedRelationshipElement == null) { + return; + } + annotatedRelationshipElement.getAnnotations().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(annotatedRelationshipElement); + } + + @Override + public default void visit(AssetAdministrationShell assetAdministrationShell) { + if (assetAdministrationShell == null) { + return; + } + visit(assetAdministrationShell.getDerivedFrom()); + visit(assetAdministrationShell.getAssetInformation()); + assetAdministrationShell.getSubmodels().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShell); + } + + @Override + public default void visit(AssetInformation assetInformation) { + if (assetInformation == null) { + return; + } + visit(assetInformation.getGlobalAssetId()); + assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); + visit(assetInformation.getDefaultThumbnail()); + AssetAdministrationShellElementVisitor.super.visit(assetInformation); + } + + @Override + public default void visit(Resource resource) { + if (resource == null) { + return; + } + AssetAdministrationShellElementVisitor.super.visit(resource); + } + + @Override + public default void visit(BasicEventElement basicEvent) { + if (basicEvent == null) { + return; + } + visit(basicEvent.getObserved()); + AssetAdministrationShellElementVisitor.super.visit(basicEvent); + } + + @Override + public default void visit(ConceptDescription conceptDescription) { + if (conceptDescription == null) { + return; + } + conceptDescription.getIsCaseOf().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(conceptDescription); + } + + @Override + public default void visit(HasDataSpecification hasDataSpecification) { + if (hasDataSpecification == null) { + return; + } + //hasDataSpecification.getEmbeddedDataSpecifications().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(hasDataSpecification); + } + + @Override + public default void visit(HasExtensions hasExtensions) { + if (hasExtensions == null) { + return; + } + hasExtensions.getExtensions().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(hasExtensions); + } + + @Override + public default void visit(HasSemantics hasSemantics) { + if (hasSemantics == null) { + return; + } + visit(hasSemantics.getSemanticId()); + AssetAdministrationShellElementVisitor.super.visit(hasSemantics); + } + + @Override + public default void visit(Identifiable identifiable) { + if (identifiable == null) { + return; + } + visit(identifiable.getAdministration()); + AssetAdministrationShellElementVisitor.super.visit(identifiable); + } + + @Override + public default void visit(SpecificAssetId specificAssetId) { + if (specificAssetId == null) { + return; + } + visit(specificAssetId.getExternalSubjectId()); + AssetAdministrationShellElementVisitor.super.visit(specificAssetId); + } + + @Override + public default void visit(MultiLanguageProperty multiLanguageProperty) { + if (multiLanguageProperty == null) { + return; + } + multiLanguageProperty.getValue().forEach(x -> visit(x)); + visit(multiLanguageProperty.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); + } + + @Override + public default void visit(OperationVariable operationVariable) { + if (operationVariable == null) { + return; + } + visit(operationVariable.getValue()); + AssetAdministrationShellElementVisitor.super.visit(operationVariable); + } + + @Override + public default void visit(Property property) { + if (property == null) { + return; + } + visit(property.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(property); + } + + @Override + public default void visit(Qualifiable qualifiable) { + if (qualifiable == null) { + return; + } + qualifiable.getQualifiers().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(qualifiable); + } + + @Override + public default void visit(Qualifier qualifier) { + if (qualifier == null) { + return; + } + visit(qualifier.getValueId()); + AssetAdministrationShellElementVisitor.super.visit(qualifier); + } + + @Override + public default void visit(Referable referable) { + if (referable == null) { + return; + } + referable.getDescription().forEach(x -> visit(x)); + referable.getDisplayName().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(referable); + } + + @Override + public default void visit(Reference reference) { + if (reference == null) { + return; + } + reference.getKeys().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(reference); + } + + @Override + public default void visit(ReferenceElement referenceElement) { + if (referenceElement == null) { + return; + } + visit(referenceElement.getValue()); + AssetAdministrationShellElementVisitor.super.visit(referenceElement); + } + + @Override + public default void visit(RelationshipElement relationshipElement) { + if (relationshipElement == null) { + return; + } + visit(relationshipElement.getFirst()); + visit(relationshipElement.getSecond()); + AssetAdministrationShellElementVisitor.super.visit(relationshipElement); + } + + @Override + public default void visit(Entity entity) { + if (entity == null) { + return; + } + visit(entity.getGlobalAssetId()); + visit(entity.getSpecificAssetId()); + entity.getStatements().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(entity); + } + + @Override + public default void visit(Extension extension) { + if (extension == null) { + return; + } + visit(extension.getRefersTo()); + AssetAdministrationShellElementVisitor.super.visit(extension); + } + + @Override + public default void visit(Environment assetAdministrationShellEnvironment) { + if (assetAdministrationShellEnvironment == null) { + return; + } + assetAdministrationShellEnvironment.getAssetAdministrationShells().forEach(x -> visit(x)); + assetAdministrationShellEnvironment.getConceptDescriptions().forEach(x -> visit(x)); + assetAdministrationShellEnvironment.getSubmodels().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShellEnvironment); + } + + @Override + public default void visit(Submodel submodel) { + if (submodel == null) { + return; + } + submodel.getSubmodelElements().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(submodel); + } + + @Override + public default void visit(SubmodelElementCollection submodelElementCollection) { + if (submodelElementCollection == null) { + return; + } + submodelElementCollection.getValue().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); + } + + @Override + public default void visit(Operation operation) { + if (operation == null) { + return; + } + operation.getInputVariables().forEach(x -> visit(x.getValue())); + operation.getInoutputVariables().forEach(x -> visit(x.getValue())); + operation.getOutputVariables().forEach(x -> visit(x.getValue())); + AssetAdministrationShellElementVisitor.super.visit(operation); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java new file mode 100644 index 000000000..28d7b36fe --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * Generic interface used by MappingProvider to infere generic arguments. This + * is used to automatically determine best-matching mapper + * + * @param The type that this Mapper can process + */ +public interface Mapper { + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java new file mode 100644 index 000000000..89fdb5859 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstract super-class for a MappingContext that already provides a + * MappingProvider + * + * @param Type of mapper the the MappingProvider can operate on + */ +public abstract class MappingContext { + + protected static final Logger log = LoggerFactory.getLogger(MappingContext.class); + protected final MappingProvider mappingProvider; + + public MappingContext(MappingProvider mappingProvider) { + this.mappingProvider = mappingProvider; + } + + public MappingProvider getMappingProvider() { + return mappingProvider; + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java new file mode 100644 index 000000000..de7108db1 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * Exception throw upon any error on mapping + */ +public class MappingException extends Exception { + + public MappingException(String msg) { + super(msg); + } + + public MappingException(String msg, Throwable err) { + super(msg, err); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java new file mode 100644 index 000000000..44e10d707 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +import com.google.common.reflect.TypeToken; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificClassComparator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Manages a set of mappers and allows finding them by type. This is the + * cornerstone functionality of the mapping framework. + * + * @param Type of mappers that are supported + */ +public class MappingProvider { + + private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); + + private final T defaultMapper; + private final T defaultCollectionMapper; + private final Map, List> mappings = new HashMap<>(); + + public MappingProvider(Class type, + Mapper defaultMapper, + Mapper> defaultCollectionMapper) { + if (type == null) { + throw new IllegalArgumentException("type must be non-null"); + } + if (defaultMapper == null) { + throw new IllegalArgumentException("defaultMapper must be non-null"); + } + if (defaultCollectionMapper == null) { + throw new IllegalArgumentException("defaultCollectionMapper must be non-null"); + } + if (!type.isAssignableFrom(defaultMapper.getClass())) { + throw new IllegalArgumentException("defaultMapper must be of type " + type); + } + if (!type.isAssignableFrom(defaultCollectionMapper.getClass())) { + throw new IllegalArgumentException("defaultCollectionMapper must be of type " + type); + } + this.defaultMapper = (T) defaultMapper; + this.defaultCollectionMapper = (T) defaultCollectionMapper; + } + + public void register(T mapper) { + TypeToken key = getMappedType(mapper.getClass()); + if (!mappings.containsKey(key)) { + mappings.put(key, new ArrayList<>()); + } + mappings.get(key).add(mapper); + } + + private TypeToken getMappedType(Class type) { + return TypeToken.of(type) + .getTypes().stream() + .filter(y -> Mapper.class.equals(y.getRawType())) + .findFirst() + .get() + .resolveType(Mapper.class.getTypeParameters()[0]); + } + + /** + * Find the most specific mapper for a given object. + * + * @param obj The object to find a suitable mapper for. If this is an + * instance of Type (e.g. a Class) type information for that is returned. + * @return The most specific mapper for the given object + */ + public T getMapper(Object obj) { + if (obj == null) { + return getMapper(Object.class); + } + if (Type.class.isAssignableFrom(obj.getClass())) { + return getMapper((Type) obj); + } + return getMapper(obj.getClass()); + } + + /** + * Find the most specific mapper for a given type. + * + * @param type The type to find a suitable mapper for. + * @return The most specific mapper for the given type + */ + public T getMapper(Type type) { + Optional> customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().isSupertypeOf(type)) + .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new MostSpecificTypeTokenComparator())) + .map(x -> x.getValue()) + .findFirst(); + if (customMapper.isEmpty() && !TypeToken.of(Collection.class).isSupertypeOf(type)) { + customMapper = mappings.entrySet().stream() + .filter(x -> x.getKey().getRawType().isAssignableFrom(TypeToken.of(type).getRawType())) + .sorted((x, y) -> Objects.compare(x.getKey().getRawType(), y.getKey().getRawType(), new MostSpecificClassComparator())) + .map(x -> x.getValue()) + .findFirst(); + } + if (customMapper.isEmpty() || customMapper.get().isEmpty()) { + if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { + return defaultCollectionMapper; + } + return defaultMapper; + } + if (customMapper.get().size() > 1) { + log.warn("found {} equally suitable mappers for type '{}'", customMapper.get().size(), type); + } + return customMapper.get().get(0); + } + +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java new file mode 100644 index 000000000..b036a0836 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * A mapper that when mapping from A to B allows to write mappers based on the + * classes of A (the source of the mapping) + * + * @param type that the mapper accepts, here: any class of A + * @param the generator type, here: to generate instances of B + * @param the type of mapping context + */ +public interface SourceBasedMapper extends Mapper { + + /** + * Maps the given value to target format via the generator. + * + * @param value the value to map + * @param generator the generator to write the mapping result to + * @param context the context of the mapping + * @throws MappingException + */ + public void map(T value, G generator, C context) throws MappingException; +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java new file mode 100644 index 000000000..b34f6e09e --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; + +/** + * A mapper that when mapping from A to B allows to write mappers based on the + * classes of B (the target of the mapping) + * + * @param type that the mapper accepts, here: any class of B + * @param

the parser type, here: to parse data of A + * @param the type of mapping context + */ +public interface TargetBasedMapper> extends Mapper { + + /** + * Reads from the parser and returns the mapping result. + * + * @param parser the parser to read the actual input + * @param context the context + * @return a new instance of T created by mapping data given by the parser + * @throws MappingException + */ + public T map(P parser, C context) throws MappingException; +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 483d4a0d9..e20d26153 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,53 +19,9 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + public class AASFull { @@ -84,50 +40,64 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_2 = createConceptDescription2(); public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); + public static final Environment ENVIRONMENT = createEnvironment(); public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) - .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - ) + .description(Arrays.asList( + new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) + //.billOfMaterial((new DefaultReference.Builder() + // .keys(new DefaultKey.Builder() + // .type(KeyTypes.SUBMODEL) + // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") + // .build())) + // .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -138,21 +108,27 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -163,7 +139,13 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Mandatory") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Mandatory") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .build(); } @@ -171,25 +153,31 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId("https://acplt.org/Test_Asset_Missing") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset_Missing") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -197,31 +185,28 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") - .displayName( - new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() - ) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -229,7 +214,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -241,22 +226,21 @@ public static Submodel createSubmodel1() { .type("http://acplt.org/Qualifier/ExampleQualifier2") .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/valueId/ACPLT") + .value("http://acplt.org/ValueId/ACPLT") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ACPLT") + .value("http://acplt.org/ValueId/ACPLT") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") - .category("VARIABLE") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -264,23 +248,8 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .supplementalSemanticIds(Arrays.asList( - new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("something_random_e14ad770") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build(), - new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("something_random_bd061acd") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build())) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -288,7 +257,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .build(); @@ -297,100 +266,106 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") + .version("0.9") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExampleValue2") + .value("http://acplt.org/ValueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExampleValue2") + .value("http://acplt.org/ValueId/ExampleValue2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId("https://acplt.org/Test_Asset2") + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value("https://acplt.org/Test_Asset2") + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build()) .build(); } @@ -398,36 +373,36 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -463,16 +438,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -505,6 +480,7 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -513,40 +489,41 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -555,24 +532,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -581,24 +558,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -607,16 +584,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -624,16 +601,16 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -655,114 +632,113 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .values(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .value(Arrays.asList( + new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") + .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) - .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range + .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -770,16 +746,16 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -787,16 +763,16 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -811,7 +787,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .build()) @@ -822,7 +798,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -891,6 +867,7 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -933,7 +910,6 @@ public static Submodel createSubmodel4() { .max(null) .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -959,7 +935,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -967,36 +943,35 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") - .build()) + .version("0.9") + .revision("0").build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1032,16 +1007,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1074,6 +1049,7 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1082,32 +1058,33 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1121,16 +1098,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1144,16 +1121,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1167,16 +1144,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1184,16 +1161,16 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1208,7 +1185,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1216,30 +1193,30 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1251,69 +1228,68 @@ public static Submodel createSubmodel6() { .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .values(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .value(Arrays.asList( + new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1321,16 +1297,16 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1338,16 +1314,16 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1372,38 +1348,39 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .kind(ModellingKind.TEMPLATE) + .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1438,17 +1415,18 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1482,33 +1460,36 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") + .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1517,17 +1498,18 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1536,17 +1518,18 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1555,34 +1538,36 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1603,64 +1588,68 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1668,100 +1657,105 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) .build()) - .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example File object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1769,21 +1763,21 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build(); } @@ -1798,15 +1792,14 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .descriptions(Arrays.asList( - new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .description(Arrays.asList( + new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) - .category("PROPERTY") .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .build(); } @@ -1816,66 +1809,71 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .version("0.9") + .revision("0") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredNames(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangString.Builder().text("Test Specification").language("de").build(), + new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") +// .levelType(LevelType.MIN) + .levelType(LevelType.MAX) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId") + .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + // TODO valueType? .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/valueId/ExamplevalueId2") + .value("http://acplt.org/ValueId/ExampleValueId2") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/valueId/ExamplevalueId2") + .value("http://acplt.org/ValueId/ExampleValueId2") .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + // TODO valueType? .build()) .build()) .build()) @@ -1906,4 +1904,4 @@ public static Environment createEnvironment() { .build(); } -} +} \ No newline at end of file diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index a57f4a418..d48733dae 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,39 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.junit.Assert; -import org.junit.Test; public class AASSimple { @@ -59,7 +29,7 @@ public class AASSimple { private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DOCUMENT = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"; private static final String ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED = "Actual rotationspeed with which the motor or feedingunit is operated"; private static final String AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD = "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird"; - private static final String ACTUAL_ROTATION_SPEED = "ActRotationSpeed"; + private static final String ACTUAL_ROTATION_SPEED = "ActualRotationSpeed"; private static final String ACTUALROTATIONSPEED = "Actualrotationspeed"; private static final String AKTUELLE_DREHZAHL = "AktuelleDrehzahl"; private static final String _1_MIN = "1/min"; @@ -81,8 +51,10 @@ public class AASSimple { private static final String TITEL = "Titel"; private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"; private static final String TITLE = "Title"; + private static final String SERVO_DC_MOTOR = "ServoDCMotor"; private static final String FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG = "file:///master/verwaltungsschale-detail-part1.png"; private static final String IMAGE_PNG = "image/png"; + private static final String THUMBNAIL = "thumbnail"; private static final String HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1 = "http://customer.com/Systems/IoT/1"; private static final String QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG = "QjYgPggjwkiHk4RrQiYSLg=="; private static final String DEVICE_ID = "DeviceID"; @@ -112,6 +84,7 @@ public class AASSimple { private static final String SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT = TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUE = "OperatingManual"; + private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE = "langString"; private static final String SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_STORED_DOCUMENT_REPRESENTATION_DIGITAL_FILE; private static final String SUBMODEL_DOCUMENTATION_FILE_ID_SHORT = "DigitalFile_PDF"; private static final String SUBMODEL_DOCUMENTATION_FILE_contentType = "application/pdf"; @@ -124,6 +97,7 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = ROTATION_SPEED; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; + private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public AASSimple() { @@ -138,6 +112,7 @@ public AASSimple() { public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = createConceptDescriptionMaxRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_ROTATIONSPEED = createConceptDescriptionRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_DOCUMENT = createConceptDescriptionDocument(); + public static final Environment ENVIRONMENT = createEnvironment(); public static AssetAdministrationShell createAAS() { return new DefaultAssetAdministrationShell.Builder() @@ -145,7 +120,13 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .globalAssetId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) + .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -154,7 +135,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -165,7 +146,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -178,7 +159,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -186,19 +167,20 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.GLOBAL_REFERENCE) + .build()) .build(); } + public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() .semanticId(new DefaultReference.Builder() @@ -206,17 +188,19 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -228,16 +212,17 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -249,37 +234,40 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModellingKind.INSTANCE) + .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() + .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -301,17 +289,17 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.STRING_TRANSLATABLE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) + .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -327,18 +315,18 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) + new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .dataType(DataTypeIEC61360.STRING) + .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -349,7 +337,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("1") + .revision("2.1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( @@ -359,23 +347,23 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -393,26 +381,26 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .dataType(DataTypeIEC61360.REAL_MEASURE) + .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -428,16 +416,16 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(ReferenceTypes.GLOBAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) + .dataType(DataTypeIEC61360.STRING) + .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); @@ -456,11 +444,4 @@ public static Environment createEnvironment() { .conceptDescriptions(createConceptDescriptionDocument()) .build(); } - - @Test - public void testAasSimpleExtensionsInitialized() { - List extensions = AASSimple.createEnvironment().getAssetAdministrationShells().get(0).getExtensions(); - Assert.assertTrue(extensions != null); - } - } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java new file mode 100644 index 000000000..995289faf --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; + + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.junit.Assert; +import org.junit.Test; + +public class AasUtilsTest { + + @Test + public void testParseReference() { + Reference reference = AasUtils.parseReference("(ModelReference)[Property]Temperature"); + Assert.assertNotNull(reference); + Assert.assertEquals(1, reference.getKeys().size()); + Assert.assertEquals(KeyTypes.PROPERTY, reference.getKeys().get(0).getType()); + Assert.assertEquals("Temperature", reference.getKeys().get(0).getValue()); + } + + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, AasUtils.deserializeEnumName(name)); + } +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index b9bc9de24..d22adf747 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import java.util.List; import java.util.Objects; @@ -28,7 +35,7 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModellingKind kind; + protected ModelingKind kind; protected Reference semanticId; @@ -42,9 +49,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -77,7 +84,7 @@ public boolean equals(Object obj) { && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } @@ -123,22 +130,32 @@ final public void setCategory(String category) { } @Override - final public List getDescriptions() { + final public List getDescription() { return description; } @Override - final public void setDescriptions(List description) { + final public void setDescription(List description) { this.description = description; } @Override - final public List getDisplayNames() { + public String getChecksum() { + return null; + } + + @Override + public void setChecksum(String checksum) { + + } + + @Override + final public List getDisplayName() { return displayName; } @Override - final public void setDisplayNames(List displayName) { + final public void setDisplayName(List displayName) { this.displayName = displayName; } @@ -172,6 +189,16 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } + @Override + final public ModelingKind getKind() { + return kind; + } + + @Override + final public void setKind(ModelingKind kind) { + this.kind = kind; + } + @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 5908adfb9..efd6ef3a1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -1,9 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.io.IOException; - +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -11,8 +27,7 @@ import org.junit.Test; import org.mockito.Mockito; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; public class EnumDeserializerTest { @@ -25,38 +40,22 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } - @Test - public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { - final String name = "ANY_ENUM"; - Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); - } - @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIec61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIec61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIec61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIec61360.IRI); + assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIEC61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIEC61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIEC61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIEC61360.IRI); } @Test @@ -71,8 +70,7 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - @SuppressWarnings("rawtypes") - private void assertDeserialization(String value, Enum expected) { + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 2fb858cc0..422766102 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,18 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import java.io.IOException; - +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; public class EnumSerializerTest { @@ -36,35 +52,40 @@ public void setUp() throws Exception { @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIec61360.DATE, "DATE"); - assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIec61360.STRING, "STRING"); - assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIec61360.TIME, "TIME"); - assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIec61360.IRI, "IRI"); + assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIEC61360.DATE, "DATE"); + assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIEC61360.STRING, "STRING"); + assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIEC61360.TIME, "TIME"); + assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIEC61360.IRI, "IRI"); } @Test - public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { - assertSerialization(Direction.INPUT, "input"); - assertSerialization(Direction.OUTPUT, "output"); + public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { + assertSerialization(Direction.INPUT, "INPUT"); + assertSerialization(Direction.OUTPUT, "OUTPUT"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { - assertSerialization(StateOfEvent.ON, "on"); - assertSerialization(StateOfEvent.OFF, "off"); + public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { + assertSerialization(StateOfEvent.ON, "ON"); + assertSerialization(StateOfEvent.OFF, "OFF"); } - private void assertSerialization(Enum value, String expected) { + @Test + public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { + assertSerialization(ModelingKind.INSTANCE, "Instance"); + assertSerialization(ModelingKind.TEMPLATE, "Template"); + } + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { this.enumSerializer.serialize(value, jsonGeneratorMock, serializerProviderMock); From ddc62e27fe8ae16ce7d6e2a548d73e97c79096f5 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 10:13:02 +0200 Subject: [PATCH 05/91] Update dataformat-json project --- dataformat-json/pom.xml | 4 +- ...nistrationShellDescriptorDeserializer.java | 49 + ...ministrationShellDescriptorSerializer.java | 46 + .../json/GenericAasDeserializer.java | 49 + .../dataformat/json/GenericAasSerializer.java | 49 + .../v3/dataformat/json/JsonDeserializer.java | 336 +- .../v3/dataformat/json/JsonSerializer.java | 274 +- .../json/ReferableDeserializer.java | 55 + .../dataformat/json/ReferableSerializer.java | 46 + .../json/ReferenceDeserializer.java | 52 + .../dataformat/json/ReferenceSerializer.java | 47 + .../ReflectionAnnotationIntrospector.java | 113 + .../json/SpecificAssetIdDeserializer.java | 52 + .../json/SpecificAssetIdSerializer.java | 47 + .../json/SubmodelDescriptorDeserializer.java | 50 + .../json/SubmodelDescriptorSerializer.java | 47 + ...setAdministrationShellDescriptorMixin.java | 59 + .../json/mixins/AssetInformationMixin.java | 25 +- .../json/mixins/ConceptDescriptionMixin.java | 14 +- .../DataSpecificationIec61360Mixin.java | 25 +- .../DataSpecificationPhysicalUnitMixin.java | 101 + .../dataformat/json/mixins/EntityMixin.java | 10 +- .../v3/dataformat/json/mixins/FileMixin.java | 3 +- .../json/mixins/HasExtensionsMixin.java | 5 +- .../json/mixins/LangStringMixin.java | 33 + .../mixins/MultiLanguagePropertyMixin.java | 15 +- .../json/mixins/QualifierMixin.java | 9 +- .../json/mixins/ReferableMixin.java | 21 +- .../json/mixins/SubmodelDescriptorMixin.java | 45 + .../json/mixins/SubmodelElementListMixin.java | 6 +- .../dataformat/json/mixins/SubmodelMixin.java | 45 + .../json/modeltype/JsonTreeProcessor.java | 55 + .../json/modeltype/ModelTypeProcessor.java | 88 + dataformat-json/src/main/resources/aas.json | 641 +--- ...rationShellDescriptorDeserializerTest.java | 72 + ...strationShellDescriptorSerializerTest.java | 58 + .../dataformat/json/JsonDeserializerTest.java | 29 +- .../json/JsonReferableDeserializerTest.java | 104 +- .../json/JsonReferableSerializerTest.java | 110 +- .../json/JsonReferenceDeserializerTest.java | 96 + .../json/JsonReferenceSerializerTest.java | 79 + .../dataformat/json/JsonSerializerTest.java | 37 +- .../JsonSpecificAssetIdDeserializerTest.java | 81 + .../JsonSpecificAssetIdSerializerTest.java | 70 + ...sonSubmodelDescriptorDeserializerTest.java | 55 + .../JsonSubmodelDescriptorSerializerTest.java | 62 + .../dataformat/json/JsonValidationTest.java | 32 +- .../ReflectionAnnotationIntrospectorTest.java | 2 +- .../v3/dataformat/json/TestDataHelper.java | 73 + .../resources/AssetAdministrationShell.json | 137 +- .../src/test/resources/MotorAAS.json | 101 +- .../src/test/resources/MotorAAS_reduced.json | 262 ++ .../src/test/resources/Submodel.json | 268 +- .../src/test/resources/SubmodelElement.json | 108 +- .../resources/SubmodelElementCollection.json | 168 +- .../test/resources/SubmodelElementList.json | 277 +- .../assetAdministrationShellDescriptor.json | 112 + .../assetAdministrationShellList.json | 108 + .../src/test/resources/empty_aas.json | 2 + .../test/resources/invalidJsonExample.json | 468 +++ .../src/test/resources/jsonExample.json | 493 +++ .../resources/listOfSubmodelElements.json | 92 + .../test/resources/submodelDescriptor.json | 47 + .../resources/submodelElementListEmpty.json | 6 + .../src/test/resources/submodelList.json | 297 ++ .../resources/test_demo_full_example.json | 2878 +++++++++++++++ ...xample_withEmbeddedConceptDescription.json | 3135 +++++++++++++++++ 67 files changed, 10921 insertions(+), 1514 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java create mode 100644 dataformat-json/src/test/resources/MotorAAS_reduced.json create mode 100644 dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json create mode 100644 dataformat-json/src/test/resources/assetAdministrationShellList.json create mode 100644 dataformat-json/src/test/resources/empty_aas.json create mode 100644 dataformat-json/src/test/resources/invalidJsonExample.json create mode 100644 dataformat-json/src/test/resources/jsonExample.json create mode 100644 dataformat-json/src/test/resources/listOfSubmodelElements.json create mode 100644 dataformat-json/src/test/resources/submodelDescriptor.json create mode 100644 dataformat-json/src/test/resources/submodelElementListEmpty.json create mode 100644 dataformat-json/src/test/resources/submodelList.json create mode 100644 dataformat-json/src/test/resources/test_demo_full_example.json create mode 100644 dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index 6b807cc93..db3ad313d 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -13,12 +13,12 @@ - ${project.groupId} + ${groupId} dataformat-core ${revision} - ${project.groupId} + ${groupId} dataformat-core ${revision} tests diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java new file mode 100644 index 000000000..ae3360f42 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of AssetAdministrationShellDescriptor + */ +public interface AssetAdministrationShellDescriptorDeserializer { + + /** + * Deserializes a given string into an instance of + * the given AssetAdministrationShellDescriptor + * + * @param assetAdministrationShellDescriptor a string representation of the AssetAdministrationShellDescriptor + * @return an instance of the AssetAdministrationShellDescriptor + * @throws DeserializationException + */ + AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given AssetAdministrationShellDescriptors + * + * @param assetAdministrationShellDescriptors a string representation of an array of AssetAdministrationShellDescriptors + * @return an instance of a list of the AssetAdministrationShellDescriptors + * @throws DeserializationException + */ + List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java new file mode 100644 index 000000000..12a9d9330 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Serializer Interface for serialization of AssetAdministrationShellDescriptor + */ +public interface AssetAdministrationShellDescriptorSerializer { + + /** + * Serializes a given instance of a AssetAdministrationShellDescriptor to string + * + * @param assetAdministrationShellDescriptor the AssetAdministrationShellDescriptor to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException; + + /** + * + * @param assetAdministrationShellDescriptors the references to serialize + * @return the string representation of the list of SubmodelDescriptors + * @throws SerializationException if serialization fails + */ + String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java new file mode 100644 index 000000000..0e9ee092e --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) SAP SE 2022 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; + +import java.util.List; + +/** + * Serializer Interface for serialization of any AAS metamodel class + */ +public interface GenericAasDeserializer { + + /** + * Deserializes a given JSON String of an arbitrary AAS element + * + * @param aas_element the AAS-conform JSON object to deserialize + * @param outputClass the expected class of the aas_element + * @return the default implementation of the AAS-conform element class + * @throws DeserializationException if the deserialization fails + */ + T read(String aas_element, Class outputClass) throws DeserializationException ; + + + /** + * Deserializes a given JSON array to a list of AAS element + * + * @param aas_array the AAS-conform JSON array to deserialize + * @param outputClass the expected type of the aas_array elements + * @return a list of the default implementations of the aas_array elements + * @param type of the returned element + * @throws DeserializationException + */ + List readList(String aas_array, Class outputClass) throws DeserializationException ; +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java new file mode 100644 index 000000000..ad88697b8 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) SAP SE 2022 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Serializer Interface for serialization of any AAS metamodel class + */ +public interface GenericAasSerializer { + + /** + * Serializes a given instance of an aas element to string + * + * @param aas_element the AAS-conform element to serialize + * @return the string representation of the AAS-conform element + * @throws SerializationException if serialization fails + */ + String write(T aas_element) throws SerializationException; + + + /** + * Serializes a list of aas elements to string + * + * @param aas_elements a list of AAS-conform elements to serialize + * @param the type of the AAS elements + * @return a serialised JSON array as a string + * @throws SerializationException if serialization fails + */ + String writeList(List aas_elements, Class outputClass) throws SerializationException; + + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index d44cafa7f..406ea22e3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,40 +16,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + + /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer { +public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + // TODO + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); public JsonDeserializer() { initTypeResolver(); @@ -62,15 +59,22 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) + .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + protected SimpleModule buildCustomDeserializerModule() { + SimpleModule module = new SimpleModule(); + customDeserializers.forEach(module::addDeserializer); + return module; + } + + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() + .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -86,255 +90,119 @@ protected SimpleModule buildImplementationModule() { return module; } - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { - return mapper.readValue(value, Environment.class); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); + return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - /** - * Deserializes a given string into an instance of the given Referable - * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ public T readReferable(String src, Class outputClass) throws DeserializationException { + @Override + public T readReferable(String referable, Class outputClass) throws DeserializationException { try { - return mapper.readValue(src, outputClass); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); + return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferables(String referables, Class outputClass) throws DeserializationException { + try { + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of Referables", ex); + } } - /** - * Deserializes a given input stream into an instance of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public Reference readReference(String reference) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the Reference", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferences(String references) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of References", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + @Override + public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SpecificAssetId", ex); + } } - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ public List readReferables(String referables, Class outputClass) throws DeserializationException { + @Override + public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - return mapper.readValue(referables, new TypeReference>() { - }); + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; + return mapper.readValue(parsed,new TypeReference>(){}); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); + } } - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + @Override + public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); + } } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 563e3506e..31310e560 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,35 +16,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + +import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to + * JSON. */ -public class JsonSerializer { +public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonSerializer() { buildMapper(); } @@ -53,136 +51,194 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) + .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } + protected SimpleModule buildCustomSerializerModule() { + SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); + return module; + } + protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { - return mapper.writeValueAsString(aasEnvironment); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); + return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferable(Referable referable) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(referable)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } } - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); + @Override + public String writeReferables(List referables) throws SerializationException { + if(referables.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); + String json = objectWriter.writeValueAsString(referables); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of Referables", ex); } } - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); + @Override + public String writeReference(Reference reference) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(reference)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); } } - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferences(List references) throws SerializationException { + if(references.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); + String json = objectWriter.writeValueAsString(references); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of References", ex); + } } - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - public String write(Referable referable) throws SerializationException { + @Override + public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { try { - return mapper.writeValueAsString(referable); + return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); + throw new SerializationException("error serializing SpecificAssetId", ex); + } + } + + @Override + public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { + if(specificAssetIds.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); + String json = objectWriter.writeValueAsString(specificAssetIds); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SpecificAssetIds", ex); } } - /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables - * @throws SerializationException if serialization fails - */ - public String write(Collection referables) throws SerializationException { - if (referables == null) { + @Override + public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SubmodelDescriptor", ex); + } + } + + @Override + public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { + if(submodelDescriptors.isEmpty()){ return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } + } try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); + String json = objectWriter.writeValueAsString(submodelDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); + throw new SerializationException("error serializing list of SubmodelDescriptors", ex); } } + + @Override + public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); + } + } + + @Override + public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { + if(assetAdministrationShellDescriptors.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); + String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); + } + } + + + +// @Override +// public String write(Object aas_element) throws SerializationException { +// try { +// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore +// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); +// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing an aas-element", ex); +// } +// } + +// @Override +// public String writeList(List aas_elements, Class outputClass) throws SerializationException { +// if(aas_elements.isEmpty()){ +// return null; +// } +// +// try { +// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); +// String json = objectWriter.writeValueAsString(aas_elements); +// +// return mapper.writeValueAsString(this.mapper.readTree(json)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing list of AAS elements", ex); +// } +// } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java new file mode 100644 index 000000000..501ee11ce --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface ReferableDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param referable a string representation of the + * Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException + */ + T readReferable(String referable, Class outputClass) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param referables a string representation of an + * array of Referables + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of a list of the referables + * @throws DeserializationException + */ + List readReferables(String referables, Class outputClass) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java new file mode 100644 index 000000000..41231cbfc --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface ReferableSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param referable the referable to serialize + * @return the string representation of the referable + * @throws SerializationException if serialization fails + */ + String writeReferable(Referable referable) throws SerializationException; + + /** + * + * @param referables the referables to serialize + * @return the string representation of the list of referables + * @throws SerializationException if serialization fails + */ + String writeReferables(List referables) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java new file mode 100644 index 000000000..99d877dd1 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface ReferenceDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param reference a string representation of the + * Reference + * @return an instance of the referable + * @throws DeserializationException + */ + Reference readReference(String reference) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param references a string representation of an + * array of References + * @return an instance of a list of the references + * @throws DeserializationException + */ + List readReferences(String references) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java new file mode 100644 index 000000000..affda40f4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface ReferenceSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param reference the Reference to serialize + * @return the string representation of the reference + * @throws SerializationException if serialization fails + */ + String writeReference(Reference reference) throws SerializationException; + + /** + * + * @param references the references to serialize + * @return the string representation of the list of references + * @throws SerializationException if serialization fails + */ + String writeReferences(List references) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java new file mode 100644 index 000000000..53c94daf3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.introspect.Annotated; +import com.fasterxml.jackson.databind.introspect.AnnotatedClass; +import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.jsontype.NamedType; +import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +/** + * This class helps to dynamically decide how to de-/serialize classes and + * properties defined in the AAS model library. + * + * This is equivalent to adding the following annotations + *

    + *
  • to all interfaces defined in the AAS model: + *
      + *
    • @JsonTypeName([interface name]) + *
    • @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "modelType") + *
    • @JsonSubTypes({ + * + * \@Type(value = [sub-interface].class, name = "[sub-interface name]"), ...}) + * for each sub-interface + *
    + *
  • to all getter methods returning any type of Collection<?> defined in the + * AAS model: + *
      + *
    • @JsonInclude(JsonInclude.Include.NON_EMPTY)
    • + *
    + *
+ */ +public class ReflectionAnnotationIntrospector extends JacksonAnnotationIntrospector { + + private static final long serialVersionUID = 1L; + + private static final String MODEL_TYPE_PROPERTY = "modelType"; + private static final String GETTER_PREFIX = "get"; + + @Override + public String findTypeName(AnnotatedClass ac) { + String customType = ReflectionHelper.getModelType(ac.getRawType()); + return customType != null + ? customType + : super.findTypeName(ac); + } + + @Override + public TypeResolverBuilder findTypeResolver(MapperConfig config, AnnotatedClass ac, JavaType baseType) { + String modelType = ReflectionHelper.getModelType(ac.getRawType()); + if (modelType != null) { + TypeResolverBuilder result = _constructStdTypeResolverBuilder(); + result = result.init(JsonTypeInfo.Id.NAME, null); + result.inclusion(JsonTypeInfo.As.PROPERTY); + result.typeProperty(MODEL_TYPE_PROPERTY); + result.typeIdVisibility(false); + return result; + } + return super.findTypeResolver(config, ac, baseType); + } + + @Override + public List findSubtypes(Annotated a) { + if (ReflectionHelper.SUBTYPES.containsKey(a.getRawType()) && !ReflectionHelper.SUBTYPES.get(a.getRawType()).isEmpty()) { + return ReflectionHelper.SUBTYPES.get(a.getRawType()).stream() + .map(x -> new NamedType(x, x.getSimpleName())) + .collect(Collectors.toList()); + } + return super.findSubtypes(a); + } + + @Override + public JsonInclude.Value findPropertyInclusion(Annotated a) { + JsonInclude.Value result = super.findPropertyInclusion(a); + if (result != JsonInclude.Value.empty()) { + return result; + } + if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { + AnnotatedMethod method = (AnnotatedMethod) a; + if (method.getParameterCount() == 0 + && method.getName().startsWith(GETTER_PREFIX) + && Collection.class.isAssignableFrom(method.getRawReturnType()) + && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { + return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); + } + } + return result; + } + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java new file mode 100644 index 000000000..74c9145f3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of referables + */ +public interface SpecificAssetIdDeserializer { + + /** + * Deserializes a given string into an instance of + * the given Referable + * + * @param specificAssetId a string representation of the + * specificAssetId + * @return an instance of the referable + * @throws DeserializationException + */ + SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given Referables + * + * @param specificAssetIds a string representation of an + * array of specificAssetIds + * @return an instance of a list of the referables + * @throws DeserializationException + */ + List readSpecificAssetIds(String specificAssetIds) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java new file mode 100644 index 000000000..d87ad3a81 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + +/** + * Serializer Interface for serialization of referables + */ +public interface SpecificAssetIdSerializer { + + /** + * Serializes a given instance of a Referable to string + * + * @param specificAssetId the SpecificAssetId to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException; + + /** + * + * @param specificAssetIds the references to serialize + * @return the string representation of the list of SpecificAssetIds + * @throws SerializationException if serialization fails + */ + String writeSpecificAssetIds(List specificAssetIds) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java new file mode 100644 index 000000000..6f157e9f3 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Deserializer Interface for deserialization of SubmodelDescriptor + */ +public interface SubmodelDescriptorDeserializer { + + /** + * Deserializes a given string into an instance of + * the given SubmodelDescriptor + * + * @param submodelDescriptor a string representation of the SubmodelDescriptor + * @return an instance of the SubmodelDescriptor + * @throws DeserializationException + */ + SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException; + + /** + * Deserializes a given string into an instance of + * a list of the given SubmodelDescriptors + * + * @param submodelDescriptors a string representation of an array of SubmodelDescriptors + * @return an instance of a list of the SubmodelDescriptors + * @throws DeserializationException + */ + List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java new file mode 100644 index 000000000..38ccce841 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +/** + * Serializer Interface for serialization of SubmodelDescriptor + */ +public interface SubmodelDescriptorSerializer { + + /** + * Serializes a given instance of a SubmodelDescriptor to string + * + * @param submodelDescriptor the SubmodelDescriptor to serialize + * @return the string representation of the SpecificAssetId + * @throws SerializationException if serialization fails + */ + String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException; + + /** + * + * @param submodelDescriptors the references to serialize + * @return the string representation of the list of SubmodelDescriptors + * @throws SerializationException if serialization fails + */ + String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException; + +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java new file mode 100644 index 000000000..93528fee5 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +public interface AssetAdministrationShellDescriptorMixin { + + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + + @JsonProperty("descriptions") + public List getDescription(); + + @JsonProperty("descriptions") + public void setDescription(List description); + + @JsonProperty("displayNames") + public List getDisplayName(); + + @JsonProperty("displayNames") + public void setDisplayName(List displayName); + + @JsonProperty("submodelDescriptors") + public List getSubmodelDescriptor(); + + @JsonProperty("submodelDescriptors") + public void setSubmodelDescriptor(List submodelDescriptor); + + @JsonProperty("specificAssetIds") + public SpecificAssetId getSpecificAssetId(); + + @JsonProperty("specificAssetIds") + public void setSpecificAssetId(SpecificAssetId specificAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 1e88c6d7f..692601fde 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +17,28 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + public interface AssetInformationMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); + @JsonProperty("thumbnail") + public void setDefaultThumbnail(File value); - @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + @JsonProperty("thumbnail") + public File getDefaultThumbnail(); - @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + @JsonProperty("billOfMaterial") + public List getBillOfMaterials(); + + @JsonProperty("billOfMaterial") + public void setBillOfMaterials(List billOfMaterials); + + @JsonInclude(JsonInclude.Include.ALWAYS) + public AssetKind getAssetKind(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index f5aadcd1b..919c02f51 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +17,23 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOf(); + public List getIsCaseOfs(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOf); + public void setIsCaseOfs(List isCaseOfs); +// +// @JsonProperty("embeddedDataSpecifications") +// public List getEmbeddedDataSpecifications(); +// +// @JsonProperty("embeddedDataSpecifications") +// @JsonDeserialize(using = DataSpecificationDeserializer.class) + + // TODO public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 88ec3908d..67576b8cd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,30 +18,32 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; + +// TODO import io.adminshell.aas.v3.model.LevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -public interface DataSpecificationIec61360Mixin { +public interface DataSpecificationIEC61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); - @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); + // TODO + // @JsonProperty("levelType") + // public void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + public List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + public void setPreferredName(List preferredName); - @JsonProperty("unitId") - public Reference getUnitID(); + @JsonProperty("shortName") + public List getShortName(); - public @JsonProperty("unitId") - void setUnitID(Reference unitID); + @JsonProperty("shortName") + public void setShortName(List shortName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java new file mode 100644 index 000000000..3c135cfa4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + +public interface DataSpecificationPhysicalUnitMixin { + + @JsonProperty("conversionFactor") + public List getConversionFactors(); + + @JsonProperty("conversionFactor") + public void setConversionFactors(List conversionFactors); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("definition") + public List getDefinition(); + + @JsonProperty("definition") + public void setDefinition(List definition); + + @JsonProperty("dinNotation") + public List getDinNotations(); + + @JsonProperty("dinNotation") + public void setDinNotations(List dinNotations); + + @JsonProperty("eceCode") + public List getEceCodes(); + + @JsonProperty("eceCode") + public void setEceCodes(List eceCodes); + + @JsonProperty("eceName") + public List getEceNames(); + + @JsonProperty("eceName") + public void setEceNames(List eceNames); + + @JsonProperty("nistName") + public List getNistNames(); + + @JsonProperty("nistName") + public void setNistNames(List nistNames); + + @JsonProperty("siName") + public List getSiNames(); + + @JsonProperty("siName") + public void setSiNames(List siNames); + + @JsonProperty("siNotation") + public List getSiNotations(); + + @JsonProperty("siNotation") + public void setSiNotations(List siNotations); + + @JsonProperty("registrationAuthorityId") + public List getRegistrationAuthorityIds(); + + @JsonProperty("registrationAuthorityId") + public void setRegistrationAuthorityIds(List registrationAuthorityIds); + + @JsonProperty("supplier") + public List getSuppliers(); + + @JsonProperty("supplier") + public void setSuppliers(List suppliers); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("unitName") + public List getUnitNames(); + + @JsonProperty("unitName") + public void setUnitNames(List unitNames); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("unitSymbol") + public List getUnitSymbols(); + + @JsonProperty("unitSymbol") + public void setUnitSymbols(List unitSymbols); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index c6d9a89ef..e32fd4385 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,15 +19,16 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public EntityType getEntityType(); - @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + @JsonProperty("specificAssetIds") + public SpecificAssetId getExternalAssetId(); - @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + @JsonProperty("specificAssetIds") + public void setExternalAssetId(SpecificAssetId externalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 91b903b08..70c41f799 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,5 +21,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getContentType(); + public String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index d97c658e3..b39b6a735 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +24,9 @@ public interface HasExtensionsMixin { - @JsonProperty("extension") + @JsonProperty("extensions") public List getExtensions(); - @JsonProperty("extension") + @JsonProperty("extensions") public void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java new file mode 100644 index 000000000..20a22471d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +public interface LangStringMixin { + + @JsonProperty("text") + @JsonInclude(JsonInclude.Include.ALWAYS) + public String getText(); + + @JsonProperty("text") + public void setText(String value); + + @JsonInclude(JsonInclude.Include.ALWAYS) + public String getLanguage(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index cacb010eb..554ce2b7c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +17,16 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + public List getValue(); @JsonProperty("value") - public void setValue(LangStringTextType value); - - @JsonProperty("valueId") - public Reference getValueID(); - - @JsonProperty("valueId") - public void setValueID(Reference valueID); + public void setValue(LangString value); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 6cdd8c2a3..18da0db82 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +17,9 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public String getType(); - - @JsonProperty("valueId") - public Reference getValueID(); - - @JsonProperty("valueId") - void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index d93eb2c17..c98dd784a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,23 +16,31 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import java.util.List; +import java.util.Set; public interface ReferableMixin { + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayNames); + public void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java new file mode 100644 index 000000000..95826b52d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + +public interface SubmodelDescriptorMixin { + + @JsonProperty("descriptions") + public List getDescription(); + + @JsonProperty("descriptions") + public void setDescription(List description); + + @JsonProperty("displayNames") + public List getDisplayName(); + + @JsonProperty("displayNames") + public void setDisplayName(List displayName); + + @JsonProperty("specificAssetIds") + public SpecificAssetId getSpecificAssetId(); + + @JsonProperty("specificAssetIds") + public void setSpecificAssetId(SpecificAssetId specificAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 5ca0161db..68ad53ec7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java new file mode 100644 index 000000000..56d53fc33 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.Collection; +import java.util.List; + +public interface SubmodelMixin { + + @JsonProperty("idShort") + public String getIdShort(); + + @JsonProperty("idShort") + public void setIdShort(String idShort); + + @JsonProperty("description") + public List getDescription(); + + @JsonProperty("description") + public void setDescription(List description); + + @JsonProperty("displayName") + public List getDisplayName(); + + @JsonProperty("displayName") + public void setDisplayName(List displayName); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java new file mode 100644 index 000000000..60de90b26 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import java.util.function.Consumer; + +/** + * Helper class to traverse a JsonNode recursive and applying an operation to + * each node + */ +public class JsonTreeProcessor { + + private final Consumer operator; + + public static void traverse(JsonNode node, Consumer operator) { + new JsonTreeProcessor(operator).traverse(node); + } + + public JsonTreeProcessor(Consumer operator) { + this.operator = operator; + } + + public void traverse(JsonNode node) { + if (null == node.getNodeType()) { + return; + } + switch (node.getNodeType()) { + case ARRAY: + node.elements().forEachRemaining(x -> traverse(x)); + break; + case OBJECT: + operator.accept((ObjectNode) node); + node.elements().forEachRemaining(x -> traverse(x)); + break; + default: + // do nothing + } + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java new file mode 100644 index 000000000..19c04a054 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +/** + * Helper class to deal with nested nature of modelType property in JSON. As + * Jackson can not natively deal with such nested type information, this class + * offers functions to unwrapp the modelType information via the preprocess(...) + * method and wrap it again via postprocess(...). + */ +public class ModelTypeProcessor { + + private static final String MODEL_TYPE = "modelType"; + private static final String MODEL_TYPE_NAME = "name"; + + /** + * Unwrapps type information recursively, e.g. converts + *
+     * "modelType": {
+     *      "name": "Foo"
+     * }
+     * 
to + *
+     * "modelType": "Foo"
+     * 
+ * + * @param json json as string + * @return root node with unwrapped type information + * @throws JsonProcessingException parsing JSON fails + */ + public static JsonNode preprocess(String json) throws JsonProcessingException { + JsonNode result = new ObjectMapper().readTree(json); + JsonTreeProcessor.traverse(result, + x -> { + if (x.get(MODEL_TYPE) != null) { + x.replace(MODEL_TYPE, x.get(MODEL_TYPE).get(MODEL_TYPE_NAME)); + } + }); + return result; + } + + /** + * Wraps type information recursively, e.g. converts + *
+     * "modelType": "Foo"
+     * 
to + *
+     * "modelType": {
+     *      "name": "Foo"
+     * }
+     * 
+ * + * @param node root node + * @return transformed root node + * @throws JsonProcessingException parsing JSON fails + */ + public static JsonNode postprocess(JsonNode node) throws JsonProcessingException { + JsonTreeProcessor.traverse(node, + x -> { + if (x.get(MODEL_TYPE) != null && x.get(MODEL_TYPE).isTextual()) { + ObjectNode nodeModelType = JsonNodeFactory.instance.objectNode(); + nodeModelType.set(MODEL_TYPE_NAME, JsonNodeFactory.instance.textNode(x.get(MODEL_TYPE).asText())); + x.replace(MODEL_TYPE, nodeModelType); + } + }); + return node; + } +} diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 496811106..3d0b2a302 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -7,7 +7,7 @@ "$ref": "#/definitions/Environment" } ], - "$id": "https://admin-shell.io/aas/3/0", + "$id": "https://admin-shell.io/aas/3/0/RC02", "definitions": { "AasSubmodelElements": { "type": "string", @@ -31,24 +31,6 @@ "SubmodelElementList" ] }, - "AbstractLangString": { - "type": "object", - "properties": { - "language": { - "type": "string", - "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" - }, - "text": { - "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - } - }, - "required": [ - "language", - "text" - ] - }, "AdministrativeInformation": { "allOf": [ { @@ -58,42 +40,11 @@ "properties": { "version": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 4 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^(0|[1-9][0-9]*)$" - } - ] + "minLength": 1 }, "revision": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 4 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^(0|[1-9][0-9]*)$" - } - ] - }, - "creator": { - "$ref": "#/definitions/Reference" - }, - "templateId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } } } @@ -102,19 +53,16 @@ "AnnotatedRelationshipElement": { "allOf": [ { - "$ref": "#/definitions/RelationshipElement_abstract" + "$ref": "#/definitions/RelationshipElement" }, { "properties": { "annotations": { "type": "array", "items": { - "$ref": "#/definitions/DataElement_choice" + "$ref": "#/definitions/DataElement" }, "minItems": 1 - }, - "modelType": { - "const": "AnnotatedRelationshipElement" } } } @@ -142,9 +90,6 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 - }, - "modelType": { - "const": "AssetAdministrationShell" } }, "required": [ @@ -160,10 +105,7 @@ "$ref": "#/definitions/AssetKind" }, "globalAssetId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "$ref": "#/definitions/Reference" }, "specificAssetIds": { "type": "array", @@ -172,12 +114,6 @@ }, "minItems": 1 }, - "assetType": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, "defaultThumbnail": { "$ref": "#/definitions/Resource" } @@ -190,7 +126,6 @@ "type": "string", "enum": [ "Instance", - "NotApplicable", "Type" ] }, @@ -212,27 +147,22 @@ }, "messageTopic": { "type": "string", - "minLength": 1, - "maxLength": 255, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "messageBroker": { "$ref": "#/definitions/Reference" }, "lastUpdate": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "minInterval": { "type": "string", - "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "maxInterval": { "type": "string", - "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" - }, - "modelType": { - "const": "BasicEventElement" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" } }, "required": [ @@ -256,21 +186,8 @@ }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] - }, - "modelType": { - "const": "Blob" + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -280,18 +197,7 @@ ] }, "Capability": { - "allOf": [ - { - "$ref": "#/definitions/SubmodelElement" - }, - { - "properties": { - "modelType": { - "const": "Capability" - } - } - } - ] + "$ref": "#/definitions/SubmodelElement" }, "ConceptDescription": { "allOf": [ @@ -309,9 +215,6 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 - }, - "modelType": { - "const": "ConceptDescription" } } } @@ -320,28 +223,6 @@ "DataElement": { "$ref": "#/definitions/SubmodelElement" }, - "DataElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/Blob" - }, - { - "$ref": "#/definitions/File" - }, - { - "$ref": "#/definitions/MultiLanguageProperty" - }, - { - "$ref": "#/definitions/Property" - }, - { - "$ref": "#/definitions/Range" - }, - { - "$ref": "#/definitions/ReferenceElement" - } - ] - }, "DataSpecificationContent": { "type": "object", "properties": { @@ -353,14 +234,7 @@ "modelType" ] }, - "DataSpecificationContent_choice": { - "oneOf": [ - { - "$ref": "#/definitions/DataSpecificationIec61360" - } - ] - }, - "DataSpecificationIec61360": { + "DataSpecificationIEC61360": { "allOf": [ { "$ref": "#/definitions/DataSpecificationContent" @@ -370,64 +244,54 @@ "preferredName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringPreferredNameTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "shortName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringShortNameTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "unit": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "unitId": { "$ref": "#/definitions/Reference" }, "sourceOfDefinition": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "symbol": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "dataType": { - "$ref": "#/definitions/DataTypeIec61360" + "$ref": "#/definitions/DataTypeIEC61360" }, "definition": { "type": "array", "items": { - "$ref": "#/definitions/LangStringDefinitionTypeIec61360" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "valueFormat": { "type": "string", - "minLength": 1, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueList": { "$ref": "#/definitions/ValueList" }, "value": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "type": "string" }, "levelType": { "$ref": "#/definitions/LevelType" - }, - "modelType": { - "const": "DataSpecificationIec61360" } }, "required": [ @@ -436,6 +300,77 @@ } ] }, + "DataSpecificationPhysicalUnit": { + "allOf": [ + { + "$ref": "#/definitions/DataSpecificationContent" + }, + { + "properties": { + "unitName": { + "type": "string", + "minLength": 1 + }, + "unitSymbol": { + "type": "string", + "minLength": 1 + }, + "definition": { + "type": "array", + "items": { + "$ref": "#/definitions/LangString" + }, + "minItems": 1 + }, + "siNotation": { + "type": "string", + "minLength": 1 + }, + "siName": { + "type": "string", + "minLength": 1 + }, + "dinNotation": { + "type": "string", + "minLength": 1 + }, + "eceName": { + "type": "string", + "minLength": 1 + }, + "eceCode": { + "type": "string", + "minLength": 1 + }, + "nistName": { + "type": "string", + "minLength": 1 + }, + "sourceOfDefinition": { + "type": "string", + "minLength": 1 + }, + "conversionFactor": { + "type": "string", + "minLength": 1 + }, + "registrationAuthorityId": { + "type": "string", + "minLength": 1 + }, + "supplier": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "unitName", + "unitSymbol", + "definition" + ] + } + ] + }, "DataTypeDefXsd": { "type": "string", "enum": [ @@ -445,6 +380,8 @@ "xs:byte", "xs:date", "xs:dateTime", + "xs:dateTimeStamp", + "xs:dayTimeDuration", "xs:decimal", "xs:double", "xs:duration", @@ -468,10 +405,11 @@ "xs:unsignedByte", "xs:unsignedInt", "xs:unsignedLong", - "xs:unsignedShort" + "xs:unsignedShort", + "xs:yearMonthDuration" ] }, - "DataTypeIec61360": { + "DataTypeIEC61360": { "type": "string", "enum": [ "BLOB", @@ -509,7 +447,7 @@ "$ref": "#/definitions/Reference" }, "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent_choice" + "$ref": "#/definitions/DataSpecificationContent" } }, "required": [ @@ -527,7 +465,7 @@ "statements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 }, @@ -535,20 +473,10 @@ "$ref": "#/definitions/EntityType" }, "globalAssetId": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - "specificAssetIds": { - "type": "array", - "items": { - "$ref": "#/definitions/SpecificAssetId" - }, - "minItems": 1 + "$ref": "#/definitions/Reference" }, - "modelType": { - "const": "Entity" + "specificAssetId": { + "$ref": "#/definitions/SpecificAssetId" } }, "required": [ @@ -610,20 +538,18 @@ }, "topic": { "type": "string", - "minLength": 1, - "maxLength": 255, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "subjectId": { "$ref": "#/definitions/Reference" }, "timeStamp": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" }, "payload": { "type": "string", - "contentEncoding": "base64" + "minLength": 1 } }, "required": [ @@ -641,9 +567,7 @@ "properties": { "name": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -652,11 +576,7 @@ "type": "string" }, "refersTo": { - "type": "array", - "items": { - "$ref": "#/definitions/Reference" - }, - "minItems": 1 + "$ref": "#/definitions/Reference" } }, "required": [ @@ -674,36 +594,13 @@ "properties": { "value": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] - }, - "modelType": { - "const": "File" + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -740,7 +637,7 @@ "type": "object", "properties": { "kind": { - "$ref": "#/definitions/ModellingKind" + "$ref": "#/definitions/ModelingKind" } } }, @@ -771,9 +668,7 @@ }, "id": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } }, "required": [ @@ -790,9 +685,7 @@ }, "value": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 } }, "required": [ @@ -829,97 +722,29 @@ "SubmodelElementList" ] }, - "LangStringDefinitionTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 1023 - } - } - } - ] - }, - "LangStringNameType": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 128 - } - } - } - ] - }, - "LangStringPreferredNameTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 255 - } - } - } - ] - }, - "LangStringShortNameTypeIec61360": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 18 - } - } - } - ] - }, - "LangStringTextType": { - "allOf": [ - { - "$ref": "#/definitions/AbstractLangString" - }, - { - "properties": { - "text": { - "maxLength": 1023 - } - } - } - ] - }, - "LevelType": { + "LangString": { "type": "object", "properties": { - "min": { - "type": "boolean" - }, - "nom": { - "type": "boolean" - }, - "typ": { - "type": "boolean" + "language": { + "type": "string", + "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" }, - "max": { - "type": "boolean" + "text": { + "type": "string" } }, "required": [ - "min", - "nom", - "typ", - "max" + "language", + "text" + ] + }, + "LevelType": { + "type": "string", + "enum": [ + "Max", + "Min", + "Nom", + "Typ" ] }, "ModelType": { @@ -931,7 +756,8 @@ "Blob", "Capability", "ConceptDescription", - "DataSpecificationIec61360", + "DataSpecificationIEC61360", + "DataSpecificationPhysicalUnit", "Entity", "File", "MultiLanguageProperty", @@ -945,7 +771,7 @@ "SubmodelElementList" ] }, - "ModellingKind": { + "ModelingKind": { "type": "string", "enum": [ "Instance", @@ -962,15 +788,12 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/LangStringTextType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "valueId": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "MultiLanguageProperty" } } } @@ -1003,9 +826,6 @@ "$ref": "#/definitions/OperationVariable" }, "minItems": 1 - }, - "modelType": { - "const": "Operation" } } } @@ -1015,7 +835,7 @@ "type": "object", "properties": { "value": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" } }, "required": [ @@ -1037,9 +857,6 @@ }, "valueId": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "Property" } }, "required": [ @@ -1078,9 +895,7 @@ }, "type": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -1122,9 +937,6 @@ }, "max": { "type": "string" - }, - "modelType": { - "const": "Range" } }, "required": [ @@ -1142,39 +954,31 @@ "properties": { "category": { "type": "string", - "minLength": 1, - "maxLength": 128, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "idShort": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 128 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" - } - ] + "maxLength": 128, + "pattern": "^[a-zA-Z][a-zA-Z0-9_]+$" }, "displayName": { "type": "array", "items": { - "$ref": "#/definitions/LangStringNameType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, "description": { "type": "array", "items": { - "$ref": "#/definitions/LangStringTextType" + "$ref": "#/definitions/LangString" }, "minItems": 1 }, + "checksum": { + "type": "string", + "minLength": 1 + }, "modelType": { "$ref": "#/definitions/ModelType" } @@ -1216,9 +1020,6 @@ "properties": { "value": { "$ref": "#/definitions/Reference" - }, - "modelType": { - "const": "ReferenceElement" } } } @@ -1227,25 +1028,11 @@ "ReferenceTypes": { "type": "string", "enum": [ - "ExternalReference", + "GlobalReference", "ModelReference" ] }, "RelationshipElement": { - "allOf": [ - { - "$ref": "#/definitions/RelationshipElement_abstract" - }, - { - "properties": { - "modelType": { - "const": "RelationshipElement" - } - } - } - ] - }, - "RelationshipElement_abstract": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1266,48 +1053,18 @@ } ] }, - "RelationshipElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/RelationshipElement" - }, - { - "$ref": "#/definitions/AnnotatedRelationshipElement" - } - ] - }, "Resource": { "type": "object", "properties": { "path": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 2000 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" - } - ] + "minLength": 1, + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" }, "contentType": { "type": "string", - "allOf": [ - { - "minLength": 1, - "maxLength": 100 - }, - { - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" - }, - { - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" - } - ] + "minLength": 1, + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" } }, "required": [ @@ -1323,15 +1080,11 @@ "properties": { "name": { "type": "string", - "minLength": 1, - "maxLength": 64, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "value": { "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "minLength": 1 }, "externalSubjectId": { "$ref": "#/definitions/Reference" @@ -1339,7 +1092,8 @@ }, "required": [ "name", - "value" + "value", + "externalSubjectId" ] } ] @@ -1373,12 +1127,9 @@ "submodelElements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 - }, - "modelType": { - "const": "Submodel" } } } @@ -1389,6 +1140,9 @@ { "$ref": "#/definitions/Referable" }, + { + "$ref": "#/definitions/HasKind" + }, { "$ref": "#/definitions/HasSemantics" }, @@ -1410,12 +1164,9 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement_choice" + "$ref": "#/definitions/SubmodelElement" }, "minItems": 1 - }, - "modelType": { - "const": "SubmodelElementCollection" } } } @@ -1431,6 +1182,13 @@ "orderRelevant": { "type": "boolean" }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement" + }, + "minItems": 1 + }, "semanticIdListElement": { "$ref": "#/definitions/Reference" }, @@ -1439,16 +1197,6 @@ }, "valueTypeListElement": { "$ref": "#/definitions/DataTypeDefXsd" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement_choice" - }, - "minItems": 1 - }, - "modelType": { - "const": "SubmodelElementList" } }, "required": [ @@ -1457,52 +1205,6 @@ } ] }, - "SubmodelElement_choice": { - "oneOf": [ - { - "$ref": "#/definitions/RelationshipElement" - }, - { - "$ref": "#/definitions/AnnotatedRelationshipElement" - }, - { - "$ref": "#/definitions/BasicEventElement" - }, - { - "$ref": "#/definitions/Blob" - }, - { - "$ref": "#/definitions/Capability" - }, - { - "$ref": "#/definitions/Entity" - }, - { - "$ref": "#/definitions/File" - }, - { - "$ref": "#/definitions/MultiLanguageProperty" - }, - { - "$ref": "#/definitions/Operation" - }, - { - "$ref": "#/definitions/Property" - }, - { - "$ref": "#/definitions/Range" - }, - { - "$ref": "#/definitions/ReferenceElement" - }, - { - "$ref": "#/definitions/SubmodelElementCollection" - }, - { - "$ref": "#/definitions/SubmodelElementList" - } - ] - }, "ValueList": { "type": "object", "properties": { @@ -1522,10 +1224,7 @@ "type": "object", "properties": { "value": { - "type": "string", - "minLength": 1, - "maxLength": 2000, - "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + "type": "string" }, "valueId": { "$ref": "#/definitions/Reference" diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java new file mode 100644 index 000000000..5fc1f8e6e --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class JsonAssetAdministrationShellDescriptorDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorDeserializerTest.class); + + + + public static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .externalSubjectId(TestDataHelper.createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .specificAssetId(specificAssetId) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .globalAssetId(TestDataHelper.createReference(ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultGlobalAssetId")) + .submodelDescriptor(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); + } + + @Test + public void testReadAasDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new JsonDeserializer().readAssetAdministrationShellDescriptor(expected); + AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); + + assertEquals(aasExpected, assetAdministrationShellDescriptor); + } + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java new file mode 100644 index 000000000..bd7e90a73 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.json.JSONException; +import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Set; + +import static org.junit.Assert.assertTrue; + +public class JsonAssetAdministrationShellDescriptorSerializerTest { + + + private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorSerializerTest.class); + + + @Test + public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); + + validateAndCompare(fileExpected, JsonAssetAdministrationShellDescriptorDeserializerTest.createAasDescriptor()); + } + + private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().writeAssetAdministrationShellDescriptor(descriptor); + logger.info(actual); + Set errors = new JsonSchemaValidator().validateSchema(actual); + assertTrue(errors.isEmpty()); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 8f70a124a..f42b06cfd 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,44 +18,48 @@ import static org.junit.Assert.assertEquals; +import org.junit.Assert; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.junit.Assert; -import org.junit.Test; public class JsonDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonDeserializerTest.class); + @Test public void testReadFromFile() throws Exception { - new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); } @Test public void testSimpleExample() throws Exception { - Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); - Assert.assertEquals(expected, actual); + Environment env = new JsonDeserializer().read(JsonSerializerTest.AASSIMPLE_FILE); + Assert.assertEquals(AASSimple.ENVIRONMENT, env); } @Test public void testFullExample() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); - Assert.assertEquals(expected, actual); + Environment env = new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); + Assert.assertEquals(AASFull.ENVIRONMENT, env); } @Test public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.createEnvironment()); - JsonDeserializer deserializer = new JsonDeserializer(); + String json = new JsonSerializer().write(AASSimple.ENVIRONMENT); + Deserializer deserializer = new JsonDeserializer(); Environment environment = deserializer.read(json); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 68ef1d473..4d32ad062 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,84 +18,119 @@ import static org.junit.Assert.assertEquals; +import java.io.File; import java.io.IOException; -import java.util.Collections; +import java.nio.file.Files; +import java.util.Arrays; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; + import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); + @Test public void testReadAAS() throws IOException, DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); + + assertEquals(aasExpected, aas); } @Test public void testReadAASs() throws IOException, DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); + String expected = Files.readString(fileExpected.toPath()); + List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) + ,environment.getAssetAdministrationShells().get(1)) ; + + assertEquals(aasExpected, aas); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodel.json"); + String expected = Files.readString(fileExpected.toPath()); + Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + Submodel submodelExpected = environment.getSubmodels().get(0); + + assertEquals(submodelExpected, submodel); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelList.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); + + assertEquals(submodelsExpected, submodels); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElement.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); + + assertEquals(submodelElementExpected, submodelElement); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelElementsExpected = Arrays.asList( + environment.getSubmodels().get(0).getSubmodelElements().get(0), + environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; + + assertEquals(submodelElementsExpected, submodelElements); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementList.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; + + assertEquals(submodelElementListExpected, submodelElementList); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementCollection.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; + + assertEquals(submodelElementCollectionExpected, submodelElementCollection); } - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 7df276487..43fcec6f6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,92 +16,125 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.File; import java.io.IOException; -import java.util.Collection; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.nio.file.Files; +import java.sql.Ref; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.json.JSONException; -import org.junit.Ignore; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; + +import static org.junit.Assert.assertTrue; public class JsonReferableSerializerTest { - @Test - public void testSerializeAAS() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL); - } + private static final Logger logger = LoggerFactory.getLogger(JsonReferableSerializerTest.class); @Test - public void testSerializeWithAssetInformation() throws SerializationException, JSONException, IOException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); + public void testSerializeAAS() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell assetAdministrationShell = environment.getAssetAdministrationShells().get(0); + compare("src/test/resources/assetAdministrationShell.json",assetAdministrationShell); } @Test public void testSerializeAASs() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + Environment environment = AASFull.ENVIRONMENT; + compare("src/test/resources/assetAdministrationShellList.json", + environment.getAssetAdministrationShells().get(0), environment.getAssetAdministrationShells().get(1)); } @Test - @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { - compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); + public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + Submodel submodel = environment.getSubmodels().get(0); + compare("src/test/resources/submodel.json",submodel); } @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL); + public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + Environment environment = AASFull.ENVIRONMENT; + compare("src/test/resources/submodelList.json", environment.getSubmodels().get(0), environment.getSubmodels().get(1)); } @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + public void testSerializeSubmodelAsReferable() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + List submodels = new ArrayList<>(); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(0)); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(1)); + submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(2)); + + String serializedReferenceArray = serializer.writeReferables(submodels); + + assertTrue(serializedReferenceArray.contains("\"http://acplt.org/Submodels/Assets/TestAsset/Identification\"")); } @Test public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElement = environment.getSubmodels().get(0).getSubmodelElements().get(0); + compare("src/test/resources/submodelElement.json",submodelElement); } @Test public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElement0 = environment.getSubmodels().get(0).getSubmodelElements().get(0); + SubmodelElement submodelElement1 = environment.getSubmodels().get(0).getSubmodelElements().get(1); + compare("src/test/resources/listOfSubmodelElements.json",submodelElement0,submodelElement1); } @Test public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_COLLECTION); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElementCollection submodelElementCollection = (SubmodelElementCollection) environment.getSubmodels().get(6).getSubmodelElements().get(6); + compare("src/test/resources/submodelElementCollection.json",submodelElementCollection); } @Test public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElementList submodelElementList = (SubmodelElementList) environment.getSubmodels().get(6).getSubmodelElements().get(5); + compare("src/test/resources/submodelElementList.json",submodelElementList); } @Test public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); + compare("src/test/resources/submodelElementListEmpty.json", + new DefaultSubmodelElementList.Builder() + .idShort("submodelElementList") + .orderRelevant(true) + .build()); } - @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = null; - if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Environment) exampleData.getModel()); - } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Referable) exampleData.getModel()); - } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) - && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().write((Collection) exampleData.getModel()); + private void compare(String filePathForExpected, Referable... referable) throws IOException, SerializationException, JSONException { + File fileExpected = new File(filePathForExpected); + String expected = Files.readString(fileExpected.toPath()); + String actual; + if(referable.length>1){ + actual = new JsonSerializer().writeReferables(List.of(referable)); + } else { + actual = new JsonSerializer().writeReferable(Arrays.stream(referable).findFirst().get()); } + logger.info(actual); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java new file mode 100644 index 000000000..9ab226d17 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class JsonReferenceDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonReferenceDeserializerTest.class); + + private String reference_string; + private String reference_list_string; + private String valueReferencePair_string; + + + @Before + public void prepare() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); + reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); +// valueReferencePair_string = serializer.write(((DataSpecificationIEC61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); + } + + + @Test + public void testDeserializeReference() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + Reference reference = deserializer.readReference(reference_string); + + assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); + } + +// @Test +// public void testValueReferencePair() throws DeserializationException { +// JsonDeserializer deserializer = new JsonDeserializer(); +// +// ValueReferencePair valueReferencePair = deserializer.read(valueReferencePair_string, ValueReferencePair.class); +// +// assertTrue(!valueReferencePair.getValue().isEmpty()); +// } + +// @Test +// @Ignore("No comparison of input string object to expected class implememted yet.") +// public void testNonAasElement() { +// JsonDeserializer deserializer = new JsonDeserializer(); +// +// try { +// ValueReferencePair valueReferencePair = deserializer.read(reference_string, ValueReferencePair.class); +// } catch (DeserializationException e) { +// // fine +// } +// +// fail("DeserializationException expected"); +// } + + + @Test + public void testDeserializeReferenceList() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + List referenceList = deserializer.readReferences(reference_list_string); + + assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.GLOBAL_REFERENCE)); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java new file mode 100644 index 000000000..febc36eb5 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +public class JsonReferenceSerializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonReferenceSerializerTest.class); + + + + @Test + public void testSerializeReference() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); + + String serializedReference = serializer.writeReference(reference); + + assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); + } + + +// @Test +// @Ignore("If the input parameter is not an AAS-defined element, plain Jackson works nevertheless...") +// public void testNonAasElement() throws SerializationException { +// JsonSerializer serializer = new JsonSerializer(); +// +// Object object = new ArrayList() {{ add("something"); }}; +// +// try { +// String output = serializer.write(object); +// } catch (SerializationException e) { +// // fine +// } +// +// fail("SerializationException expected"); +// } + + + + @Test + public void testSerializeReferenceList() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); + + String serializedReferenceArray = serializer.writeReferences(referenceList); + + assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); + } + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 1ea73393e..40f49d167 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,16 +21,11 @@ import java.io.File; import java.io.IOException; -import java.util.Collections; -import java.util.List; +import java.nio.file.Files; import java.util.Set; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; import org.junit.Rule; import org.junit.Test; @@ -41,7 +37,13 @@ import com.fasterxml.jackson.core.JsonProcessingException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; + public class JsonSerializerTest { + public static final java.io.File AASSIMPLE_FILE = new java.io.File("src/test/resources/jsonExample.json"); + public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); @@ -56,35 +58,28 @@ public void testSerializeNull() throws JsonProcessingException, IOException, Ser @Test public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.createEnvironment()); + new JsonSerializer().write(file, AASSimple.ENVIRONMENT); assertTrue(file.exists()); } @Test public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { - validateAndCompare(Examples.ENVIRONMENT_EMPTY); + validateAndCompare(new java.io.File("src/test/resources/empty_aas.json"), new DefaultEnvironment.Builder().build()); } @Test public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_SIMPLE); + validateAndCompare(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); } @Test public void testSerializeFullExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_FULL); + validateAndCompare(AASFULL_FILE, AASFull.ENVIRONMENT); } - @Test - public void testSerializeEmptyReferableList() throws SerializationException { - List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); - assertEquals("[]", serialized); - } - - private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = new JsonSerializer().write(exampleData.getModel()); + private void validateAndCompare(File expectedFile, Environment environment) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().write(environment); logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java new file mode 100644 index 000000000..fd3587994 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.checkerframework.checker.units.qual.A; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class JsonSpecificAssetIdDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdDeserializerTest.class); + + private String specificAssetId_string; + private String specificAssetId_list_string; + + + @Before + public void prepare() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + List specificAssetIds = new ArrayList() {{ + add(specificAssetId); + add(specificAssetId); + }}; + + specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); + specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); + } + + + @Test + public void testDeserializeReference() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + SpecificAssetId specificAssetId = deserializer.readSpecificAssetId(specificAssetId_string); + + assertTrue(!specificAssetId.getValue().isEmpty()); + } + + + @Test + public void testDeserializeReferenceList() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + + List specificAssetIdList = deserializer.readSpecificAssetIds(specificAssetId_list_string); + + assertTrue(specificAssetIdList.get(0).getValue().equalsIgnoreCase("testvalue")); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java new file mode 100644 index 000000000..37980a5b1 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +public class JsonSpecificAssetIdSerializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdSerializerTest.class); + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + + + @Test + public void testSerializeSpecificAssetId() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + String specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); + + assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); + } + + + @Test + public void testSerializeSpecificAssetIdList() throws SerializationException { + + List specificAssetIds = new ArrayList() {{ + add(specificAssetId); + add(specificAssetId); + }}; + + JsonSerializer serializer = new JsonSerializer(); + + String specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); + + assertTrue(specificAssetId_list_string.startsWith("[")); + assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); + } + + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java new file mode 100644 index 000000000..7bc2b30ff --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; +import org.junit.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class JsonSubmodelDescriptorDeserializerTest { + + public static SubmodelDescriptor getDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .build(); + } + + + @Test + public void testReadSubmodelDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelDescriptor submodelDescriptor = new JsonDeserializer().readSubmodelDescriptor(expected); + SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + + assertEquals(submodelDescriptorExpected, submodelDescriptor); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java new file mode 100644 index 000000000..d8a61dfb2 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; +import org.json.JSONException; +import org.junit.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.List; +import java.util.Set; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class JsonSubmodelDescriptorSerializerTest { + + + private static final Logger logger = LoggerFactory.getLogger(JsonSubmodelDescriptorSerializerTest.class); + + + @Test + public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + + validateAndCompare(fileExpected, JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor()); + } + + private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().writeSubmodelDescriptor(descriptor); + logger.info(actual); + Set errors = new JsonSchemaValidator().validateSchema(actual); + assertTrue(errors.isEmpty()); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java index ed0e9b08e..f9878057f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -28,7 +30,6 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import static org.junit.Assert.assertFalse; @RunWith(JUnitParamsRunner.class) public class JsonValidationTest { @@ -42,27 +43,28 @@ public static void prepareValidator() throws IOException { @Test @Parameters({ - "src/test/resources/Environment-Empty.json", - "src/test/resources/Example-Simple.json", + "src/test/resources/empty_aas.json", + "src/test/resources/jsonExample.json", "src/test/resources/MotorAAS.json", - "src/test/resources/MotorAAS-Reduced.json", - "src/test/resources/Example-Full.json" + "src/test/resources/MotorAAS_reduced.json", + "src/test/resources/test_demo_full_example.json" }) public void validateValidJson(String file) throws IOException { - assertTrue(validate(file).isEmpty()); + String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); + Set errors = validator.validateSchema(serializedEnvironment); + System.out.println("Validating: " + file); + assertTrue(errors.isEmpty()); } @Test - @Parameters({"src/test/resources/Environment-Invalid.json"}) + @Parameters({"src/test/resources/invalidJsonExample.json"}) public void validateInvalidJson(String file) throws IOException { - assertFalse(validate(file).isEmpty()); - } - - private Set validate(String file) throws IOException { - String json = new String(Files.readAllBytes(Paths.get(file))); - Set result = validator.validateSchema(json); + String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); + Set errors = validator.validateSchema(serializedEnvironment); System.out.println("Validating: " + file); - result.forEach(System.out::println); - return result; + for (String s : errors) { + System.out.println(s); + } + assertEquals(2, errors.size()); } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index a020dd4a9..4b677e6ca 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +28,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java new file mode 100644 index 000000000..575dfb2da --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 SAP SE + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + +import java.util.List; + +public class TestDataHelper { + + public static final String DEFAULT_IDENTIFICATION = "identification"; + + public static final Reference DEFAULT_SEMANTIC_ID = + new DefaultReference.Builder().type(ReferenceTypes.GLOBAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) + .build(); + + public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().build()) + .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); + + public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = + new DefaultAdministrativeInformation.Builder() + .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) + .revision("defaultAdministrativeInformationRevisionValue") + .version("defaultAdministrativeInformationVersionValue").build(); + + public static final List DEFAULT_DESCRIPTION = List.of(createLangString("en", "defaultDescription")); + + public static final List DEFAULT_DISPLAY_NAME = List.of(createLangString("en", "defaultDisplayName")); + + public static final String DEFAULT_ID_SHORT = "defaultIdShort"; + + + + + public static LangString createLangString(String langCode, String text) { + return new DefaultLangString.Builder().language(langCode).text(text).build(); + } + + public static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { + return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); + } + + public static Reference createGlobalReference(String value) { + return createReference(ReferenceTypes.GLOBAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + } + + public static DefaultEndpoint.Builder createEndpointBuilder() { + + String DEFAULT_INTERFACE_VALUE = "defaultInterface"; + + return new DefaultEndpoint.Builder() + .protocolInformation(createProtocolInformationBuilder().build()) + .withInterface(DEFAULT_INTERFACE_VALUE); + } + + public static Key createKey(KeyTypes type, String value) { + return new DefaultKey.Builder().type(type).value(value).build(); + } + + public static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { + return new DefaultProtocolInformation.Builder() + .endpointAddress("defaultEndpointAddress") + .endpointProtocol("defaultEndpointProtocol") + .endpointProtocolVersion("defaultEndpointProtocolVersion") + .subprotocol("defaultSubprotocol") + .subprotocolBody("defaultSubprotocolBody") + .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding"); + } +} diff --git a/dataformat-json/src/test/resources/AssetAdministrationShell.json b/dataformat-json/src/test/resources/AssetAdministrationShell.json index aa9b84207..dca5615c6 100644 --- a/dataformat-json/src/test/resources/AssetAdministrationShell.json +++ b/dataformat-json/src/test/resources/AssetAdministrationShell.json @@ -1,64 +1,73 @@ -{ - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ], - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell", - "administration": - { - "version": "0", - "revision": "9" - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "ExternalReference" - }, - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId":"https://acplt.org/Test_Asset" - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "ExternalReference" - } - ] -} +{ + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": + { + "version": "0.9", + "revision": "0" + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/MotorAAS.json b/dataformat-json/src/test/resources/MotorAAS.json index b0b828a79..f1207e299 100644 --- a/dataformat-json/src/test/resources/MotorAAS.json +++ b/dataformat-json/src/test/resources/MotorAAS.json @@ -6,7 +6,15 @@ "id": "http://customer.com/aas/9175_7013_7091_9168", "assetInformation": { "assetKind": "Instance", - "globalAssetId": "http://customer.com/assets/KHBVZJSQKIY", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, "specificAssetIds": [ { "name": "EquipmentID", @@ -18,7 +26,7 @@ "value": "http://customer.com/Systems/ERP/012" } ], - "type": "ExternalReference" + "type": "GlobalReference" } }, { @@ -31,12 +39,13 @@ "value": "http://customer.com/Systems/IoT/1" } ], - "type": "ExternalReference" + "type": "GlobalReference" } } ], "thumbnail": { "modelType": "File", + "kind": "Instance", "idShort": "thumbnail", "mimeType": "image/png", "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" @@ -50,7 +59,7 @@ "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, { "keys": [ @@ -59,7 +68,7 @@ "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, { "keys": [ @@ -68,7 +77,7 @@ "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" } ], - "type": "ExternalReference" + "type": "GlobalReference" } ] } @@ -83,7 +92,7 @@ "value": "0173-1#01-AFZ615#016" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "kind": "Instance", "idShort": "TechnicalData", @@ -91,6 +100,7 @@ "submodelElements": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -98,7 +108,7 @@ "value": "0173-1#02-BAA120#008" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "MaxRotationSpeed", "category": "PARAMETER", @@ -115,6 +125,7 @@ "submodelElements": [ { "modelType": "SubmodelElementCollection", + "kind": "Instance", "semanticId": { "keys": [ { @@ -122,12 +133,13 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "OperatingManual", "value": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -135,14 +147,15 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "Title", "value": "OperatingManual", - "valueType": "xs:string" + "valueType": "langString" }, { "modelType": "File", + "kind": "Instance", "semanticId": { "keys": [ { @@ -150,11 +163,11 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "DigitalFile_PDF", "contentType": "application/pdf", - "value": "file:///aasx/OperatingManual.pdf" + "value": "/aasx/OperatingManual.pdf" } ], "ordered": false, @@ -170,6 +183,7 @@ "submodelElements": [ { "modelType": "Property", + "kind": "Instance", "semanticId": { "keys": [ { @@ -177,7 +191,7 @@ "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "idShort": "RotationSpeed", "category": "Variable", @@ -201,10 +215,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "EN", @@ -215,7 +229,7 @@ "text": "Titel" } ], - "shortName": [ + "shortNames": [ { "language": "EN", "text": "Title" @@ -225,7 +239,9 @@ "text": "Titel" } ], - "dataType": "STRING_TRANSLATABLE", + "unit": "", + "sourceOfDefinition": "", + "dataType": "StringTranslatable", "definition": [ { "language": "DE", @@ -249,10 +265,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "EN", @@ -263,7 +279,7 @@ "text": "DigitaleDatei" } ], - "shortName": [ + "shortNames": [ { "language": "EN", "text": "DigitalFile" @@ -273,7 +289,9 @@ "text": "DigitaleDatei" } ], - "dataType": "STRING", + "unit": "", + "sourceOfDefinition": "", + "dataType": "String", "definition": [ { "language": "DE", @@ -302,10 +320,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "de", @@ -316,6 +334,7 @@ "text": "Max.rotationspeed" } ], + "shortNames": [], "unit": "1/min", "unitId": { "keys": [ @@ -324,9 +343,10 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, - "dataType": "REAL_MEASURE", + "sourceOfDefinition": "", + "dataType": "RealMeasure", "definition": [ { "language": "de", @@ -355,10 +375,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", + "modelType": "DataSpecificationIEC61360", "preferredName": [ { "language": "DE", @@ -369,14 +389,14 @@ "text": "Actualrotationspeed" } ], - "shortName": [ + "shortNames": [ { "language": "DE", "text": "AktuelleDrehzahl" }, { "language": "EN", - "text": "ActRotationSpeed" + "text": "ActualRotationSpeed" } ], "unit": "1/min", @@ -387,9 +407,10 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, - "dataType": "REAL_MEASURE", + "sourceOfDefinition": "", + "dataType": "RealMeasure", "definition": [ { "language": "DE", @@ -417,17 +438,12 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "ExternalReference" + "type": "GlobalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIec61360", - "preferredName": [ - { - "language": "DE", - "text": "Dokument" - } - ], - "shortName": [ + "modelType": "DataSpecificationIEC61360", + "preferredName": [], + "shortNames": [ { "language": "EN", "text": "Document" @@ -437,8 +453,9 @@ "text": "Dokument" } ], + "unit": "", "sourceOfDefinition": "[ISO15519-1:2010]", - "dataType": "STRING", + "dataType": "String", "definition": [ { "language": "DE", diff --git a/dataformat-json/src/test/resources/MotorAAS_reduced.json b/dataformat-json/src/test/resources/MotorAAS_reduced.json new file mode 100644 index 000000000..895605423 --- /dev/null +++ b/dataformat-json/src/test/resources/MotorAAS_reduced.json @@ -0,0 +1,262 @@ +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "idShort": "ExampleMotor", + "id": "http://customer.com/aas/9175_7013_7091_9168", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "modelType": "File", + "kind": "Instance", + "idShort": "thumbnail", + "mimeType": "image/png", + "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "semanticId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "kind": "Instance", + "idShort": "TechnicalData", + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "idShort": "MaxRotationSpeed", + "category": "PARAMETER", + "value": "5000", + "valueType": "xs:integer" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "OperationalData", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "idShort": "RotationSpeed", + "category": "Variable", + "value": "4370", + "valueType": "xs:integer" + } + ] + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "idShort": "MaxRotationSpeed", + "category": "PROPERTY", + "administration": { + "version": "0", + "revision": "2" + }, + "id": "0173-1#02-BAA120#008", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ], + "shortNames": [], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "en", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "RotationSpeed", + "category": "PROPERTY", + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortNames": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ] + } + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/Submodel.json b/dataformat-json/src/test/resources/Submodel.json index c3751c085..79a85f8cc 100644 --- a/dataformat-json/src/test/resources/Submodel.json +++ b/dataformat-json/src/test/resources/Submodel.json @@ -1,144 +1,124 @@ - -{ - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "ExternalReference" - }, - "administration": - { - "revision": "9", - "version": "0" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "ExternalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ], - "displayName": [ - { - "language": "en-us", - "text": "Manufacturer Name" - } - ] - }, - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "ExternalReference" - }, - "value": "978-8234-234-342", - "supplementalSemanticIds": [ - { - "keys": [ - { - "type": "GlobalReference", - "value": "something_random_e14ad770" - } - ], - "type": "ExternalReference" - }, - { - "keys": [{ - "type": "GlobalReference", - "value": "something_random_bd061acd" - }], - "type": "ExternalReference" - } - - ], - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "category": "VARIABLE", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] -} + +{ + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElement.json b/dataformat-json/src/test/resources/SubmodelElement.json index fb11778ca..aa25cb3d2 100644 --- a/dataformat-json/src/test/resources/SubmodelElement.json +++ b/dataformat-json/src/test/resources/SubmodelElement.json @@ -1,55 +1,53 @@ - -{ - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "ExternalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ], - "displayName": [ - { - "language": "en-us", - "text": "Manufacturer Name" - } - ] -} + +{ + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElementCollection.json b/dataformat-json/src/test/resources/SubmodelElementCollection.json index f0366f0f9..981979de9 100644 --- a/dataformat-json/src/test/resources/SubmodelElementCollection.json +++ b/dataformat-json/src/test/resources/SubmodelElementCollection.json @@ -1,82 +1,86 @@ -{ - "idShort": "ExampleSubmodelElementCollection", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "modelType": "SubmodelElementCollection", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "ExternalReference" - }, - "value": [ { - "modelType" : "Blob", - "contentType" : "application/pdf", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Blobs/ExampleBlob" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Blob object" - }, { - "language" : "de", - "text" : "Beispiel Blob Element" - } ], - "idShort" : "ExampleBlob" - }, { - "modelType" : "File", - "contentType" : "application/pdf", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Files/ExampleFile" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example File object" - }, { - "language" : "de", - "text" : "Beispiel File Element" - } ], - "idShort" : "ExampleFile" - }, { - "modelType" : "ReferenceElement", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } ], - "type": "ExternalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Reference Element object" - }, { - "language" : "de", - "text" : "Beispiel Reference Element Element" - } ], - "idShort" : "ExampleReferenceElement" - } ] -} +{ + "idShort": "ExampleSubmodelElementCollection", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "modelType": "SubmodelElementCollection", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "value": [ { + "modelType" : "Blob", + "contentType" : "application/pdf", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Blobs/ExampleBlob" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Blob object" + }, { + "language" : "de", + "text" : "Beispiel Blob Element" + } ], + "idShort" : "ExampleBlob" + }, { + "modelType" : "File", + "contentType" : "application/pdf", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Files/ExampleFile" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example File object" + }, { + "language" : "de", + "text" : "Beispiel File Element" + } ], + "idShort" : "ExampleFile" + }, { + "modelType" : "ReferenceElement", + "kind" : "Template", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } ], + "type" : "GlobalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Reference Element object" + }, { + "language" : "de", + "text" : "Beispiel Reference Element Element" + } ], + "idShort" : "ExampleReferenceElement" + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/SubmodelElementList.json b/dataformat-json/src/test/resources/SubmodelElementList.json index fc5dd9c06..7456c61c1 100644 --- a/dataformat-json/src/test/resources/SubmodelElementList.json +++ b/dataformat-json/src/test/resources/SubmodelElementList.json @@ -1,136 +1,141 @@ -{ - "idShort": "ExampleSubmodelElementListOrdered", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "modelType": "SubmodelElementList", - "orderRelevant": true, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "ExternalReference" - }, - "typeValueListElement": "SubmodelElement", - "value": [ - { - "idShort": "ExampleProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ], - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:string" - }, - { - "idShort": "ExampleMultiLanguageProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ], - "modelType": "MultiLanguageProperty", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "ExternalReference" - } - }, - { - "idShort": "ExampleRange", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:int", - "max": "100" - }, - { - "idShort": "ExampleRange2", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "ExternalReference" - }, - "valueType": "xs:int", - "min": "0" - } - ] -} +{ + "idShort": "ExampleSubmodelElementListOrdered", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "modelType": "SubmodelElementList", + "orderRelevant": true, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "typeValueListElement": "SubmodelElement", + "value": [ + { + "idShort": "ExampleProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ], + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:string" + }, + { + "idShort": "ExampleMultiLanguageProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ], + "modelType": "MultiLanguageProperty", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template" + }, + { + "idShort": "ExampleRange", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:int", + "max": "100" + }, + { + "idShort": "ExampleRange2", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "valueType": "xs:int", + "min": "0" + } + ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json new file mode 100644 index 000000000..17183b3dc --- /dev/null +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -0,0 +1,112 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "globalAssetId" : { + "keys" : [ { + "type" : "AssetAdministrationShell", + "value" : "defaultGlobalAssetId" + } ], + "type" : "ModelReference" + }, + "specificAssetIds" : { + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + }, + "externalSubjectId" : { + "keys" : [ { + "type" : "AssetAdministrationShell", + "value" : "defaultSpecificAssetId" + } ], + "type" : "ModelReference" + }, + "name" : "defaultSpecificAssetIdName", + "value" : "http://example.company/myAsset" + }, + "submodelDescriptors" : [ { + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + } + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellList.json b/dataformat-json/src/test/resources/assetAdministrationShellList.json new file mode 100644 index 000000000..bca2ea576 --- /dev/null +++ b/dataformat-json/src/test/resources/assetAdministrationShellList.json @@ -0,0 +1,108 @@ +[ + { + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": { + "version": "0.9", + "revision": "0" + }, + "derivedFrom": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ] + }, + { + "idShort": "Test_AssetAdministrationShell_Mandatory", + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/empty_aas.json b/dataformat-json/src/test/resources/empty_aas.json new file mode 100644 index 000000000..7a73a41bf --- /dev/null +++ b/dataformat-json/src/test/resources/empty_aas.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/invalidJsonExample.json b/dataformat-json/src/test/resources/invalidJsonExample.json new file mode 100644 index 000000000..e9474c928 --- /dev/null +++ b/dataformat-json/src/test/resources/invalidJsonExample.json @@ -0,0 +1,468 @@ +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "idShort": "ExampleMotor", + "id": "http://customer.com/aas/9175_7013_7091_9168", + "assetInformation": { + "assetKind": "Instance", + "globalAssetId": { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "modelType": "File", + "kind": "Instance", + "idShort": "thumbnail", + "contentType": "image/png", + "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "semanticId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "kind": "Instance", + "idShort": "TechnicalData", + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "idShort": "MaxRotationSpeed", + "category": "PARAMETER", + "value": "5000", + "valueType": "xs:integer" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "Documentation", + "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", + "submodelElements": [ + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" + } + ], + "type": "GlobalReference" + }, + "idShort": "OperatingManual", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" + } + ] + }, + "idShort": "Title", + "value": "OperatingManual", + "valueType": "langString" + }, + { + "modelType": "File", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" + } + ], + "type": "GlobalReference" + }, + "idShort": "DigitalFile_PDF", + "contentType": "application/pdf", + "value": "/aasx/OperatingManual.pdf" + } + ], + "ordered": false, + "allowDuplicates": false + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "idShort": "OperationalData", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "idShort": "RotationSpeed", + "category": "Variable", + "value": "4370", + "valueType": "xs:integer" + } + ] + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "idShort": "Title", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "shortNames": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "unit": "", + "sourceOfDefinition": "", + "dataType": "StringTranslatable", + "definition": [ + { + "language": "DE", + "text": "SprachabhängigerTiteldesDokuments." + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "DigitalFile", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ], + "shortNames": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ], + "unit": "", + "sourceOfDefinition": "", + "dataType": "String", + "definition": [ + { + "language": "DE", + "text": "Eine Datei, die die Document Version repräsentiert. Neben der obligatorischen PDF Datei können weitere Dateien angegeben werden." + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "MaxRotationSpeed", + "category": "PROPERTY", + "administration": { + "version": "", + "revision": "2" + }, + "id": "0173-1#02-BAA120#008", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "en", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ] + } + } + ] + }, + { + "modelType": "ConceptDescription", + "idShort": "RotationSpeed", + "category": "PROPERTY", + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortNames": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ], + "unit": "1/min", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "sourceOfDefinition": "", + "dataType": "RealMeasure", + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ] + } + } + ] + }, + { + "idShort": "Document", + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "preferredName": [ + ], + "shortNames": [ + { + "language": "EN", + "text": "Document" + }, + { + "language": "DE", + "text": "Dokument" + } + ], + "unit": "", + "sourceOfDefinition": "[ISO15519-1:2010]", + "dataType": "String", + "definition": [ + { + "language": "DE", + "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." + } + ] + } + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/jsonExample.json b/dataformat-json/src/test/resources/jsonExample.json new file mode 100644 index 000000000..41fefacbd --- /dev/null +++ b/dataformat-json/src/test/resources/jsonExample.json @@ -0,0 +1,493 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "http://customer.com/assets/KHBVZJSQKIY" + } + ], + "type": "GlobalReference" + }, + "specificAssetIds": [ + { + "name": "EquipmentID", + "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", + "externalSubjectId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/ERP/012" + } + ], + "type": "GlobalReference" + } + }, + { + "name": "DeviceID", + "value": "QjYgPggjwkiHk4RrQiYSLg==", + "externalSubjectId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://customer.com/Systems/IoT/1" + } + ], + "type": "GlobalReference" + } + } + ], + "thumbnail": { + "contentType": "image/png", + "path": "file:///master/verwaltungsschale-detail-part1.png" + } + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/7A7104BDAB57E184" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" + } + ], + "type": "GlobalReference" + } + ], + "id": "http://customer.com/aas/9175_7013_7091_9168", + "idShort": "ExampleMotor" + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING_TRANSLATABLE", + "sourceOfDefinition": "ExampleString", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "SprachabhängigerTiteldesDokuments." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ], + "shortName": [ + { + "language": "EN", + "text": "Title" + }, + { + "language": "DE", + "text": "Titel" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", + "idShort": "Title" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING", + "sourceOfDefinition": "ExampleString", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "A file representing the document version. In addition to the mandatory PDF file, other files can be specified." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "EN", + "text": "DigitalFile" + } + ], + "shortName": [ + { + "language": "EN", + "text": "DigitalFile" + }, + { + "language": "DE", + "text": "DigitaleDatei" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", + "idShort": "DigitalFile" + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "ExampleString", + "unit": "1/min", + "unitId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "definition": [ + { + "language": "de", + "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" + }, + { + "language": "EN", + "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" + } + ], + "preferredName": [ + { + "language": "de", + "text": "max.Drehzahl" + }, + { + "language": "en", + "text": "Max.rotationspeed" + } + ] + } + } + ], + "administration": + { + "revision": "2.1", + "version": "2" + }, + "id": "0173-1#02-BAA120#008", + "category": "PROPERTY", + "idShort": "MaxRotationSpeed" + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "ExampleString", + "unit": "1/min", + "unitId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#05-AAA650#002" + } + ], + "type": "GlobalReference" + }, + "definition": [ + { + "language": "DE", + "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" + }, + { + "language": "EN", + "text": "Actual rotationspeed with which the motor or feedingunit is operated" + } + ], + "preferredName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "Actualrotationspeed" + } + ], + "shortName": [ + { + "language": "DE", + "text": "AktuelleDrehzahl" + }, + { + "language": "EN", + "text": "ActualRotationSpeed" + } + ] + } + } + ], + "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", + "category": "PROPERTY", + "idShort": "RotationSpeed" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "embeddedDataSpecifications": [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "modelType": "DataSpecificationIEC61360", + "dataType": "STRING", + "sourceOfDefinition": "[ISO15519-1:2010]", + "unit": "ExampleString", + "definition": [ + { + "language": "EN", + "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." + } + ], + "preferredName": [ + { + "language": "EN", + "text": "Document" + } + ], + "shortName": [ + { + "language": "EN", + "text": "Document" + }, + { + "language": "DE", + "text": "Dokument" + } + ] + } + } + ], + "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", + "idShort": "Document" + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#01-AFZ615#016" + } + ], + "type": "GlobalReference" + }, + "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", + "idShort": "TechnicalData", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "0173-1#02-BAA120#008" + } + ], + "type": "GlobalReference" + }, + "value": "5000", + "valueType": "xs:integer", + "category": "PARAMETER", + "idShort": "MaxRotationSpeed" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", + "idShort": "Documentation", + "submodelElements": [ + { + "modelType":"SubmodelElementCollection", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" + } + ], + "type": "GlobalReference" + }, + "idShort": "OperatingManual", + "value": [ + { + "modelType": "Property", + "category": "VARIABLE", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" + } + ], + "type": "GlobalReference" + }, + "value": "OperatingManual", + "valueType": "xs:string", + "idShort": "Title" + }, + { + "modelType": "File", + "category": "VARIABLE", + "contentType": "application/pdf", + "value": "file:///aasx/OperatingManual.pdf", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" + } + ], + "type": "GlobalReference" + }, + "idShort": "DigitalFile_PDF" + } + ] + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", + "idShort": "OperationalData", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "ConceptDescription", + "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" + } + ], + "type": "GlobalReference" + }, + "value": "4370", + "valueType": "xs:integer", + "category": "VARIABLE", + "idShort": "RotationSpeed" + } + ] + } + ] +} diff --git a/dataformat-json/src/test/resources/listOfSubmodelElements.json b/dataformat-json/src/test/resources/listOfSubmodelElements.json new file mode 100644 index 000000000..8073bcbe8 --- /dev/null +++ b/dataformat-json/src/test/resources/listOfSubmodelElements.json @@ -0,0 +1,92 @@ +[ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json new file mode 100644 index 000000000..d518b60e1 --- /dev/null +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -0,0 +1,47 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "endpointAddress" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "defaultAdministrativeInformationRevisionValue", + "version" : "defaultAdministrativeInformationVersionValue", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "GlobalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIEC61360", + "preferredName" : [ ] + } + } ] + }, + "descriptions" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayNames" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "identification" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "GlobalReference" + } +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/submodelElementListEmpty.json b/dataformat-json/src/test/resources/submodelElementListEmpty.json new file mode 100644 index 000000000..ca37a7d6a --- /dev/null +++ b/dataformat-json/src/test/resources/submodelElementListEmpty.json @@ -0,0 +1,6 @@ +{ + "modelType" : "SubmodelElementList", + "idShort" : "submodelElementList", + "orderRelevant" : true, + "kind": "Instance" +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/submodelList.json b/dataformat-json/src/test/resources/submodelList.json new file mode 100644 index 000000000..9337b3480 --- /dev/null +++ b/dataformat-json/src/test/resources/submodelList.json @@ -0,0 +1,297 @@ +[ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + }, + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + ], + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + }, + { + "modelType": "Entity", + "entityType": "SelfManagedEntity", + "kind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example bill of material submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" + } + ] + } +] diff --git a/dataformat-json/src/test/resources/test_demo_full_example.json b/dataformat-json/src/test/resources/test_demo_full_example.json new file mode 100644 index 000000000..5a6adcd08 --- /dev/null +++ b/dataformat-json/src/test/resources/test_demo_full_example.json @@ -0,0 +1,2878 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell", + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ], + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "idShort": "Test_AssetAdministrationShell_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", + "idShort": "Test_AssetAdministrationShell2_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Missing" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription", + "idShort": "TestConceptDescription", + "isCaseOf": [ + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription" + } + ], + "type": "GlobalReference" + } + ], + "description": [ + { + "language": "en-us", + "text": "An example concept description for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "id": "https://acplt.org/Test_ConceptDescription_Mandatory", + "idShort": "Test_ConceptDescription_Mandatory" + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription_Missing", + "idShort": "TestConceptDescription1", + "description": [ + { + "language": "en-us", + "text": "An example concept description for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "ConceptDescription", + "category": "PROPERTY", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/DataSpecifciations/Example/Identification", + "idShort": "TestSpec_01", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" + } + ], + "type": "GlobalReference" + } + ], + "embeddedDataSpecifications": + [ + { + "dataSpecification": { + "keys": [ + { + "type": "GlobalReference", + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": { + "modelType": "DataSpecificationIEC61360", + "dataType": "REAL_MEASURE", + "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", + "symbol": "SU", + "unit": "SpaceUnit", + "unitId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Units/SpaceUnit" + } + ], + "type": "GlobalReference" + }, + "value": "TEST", + "valueFormat": "string", + "valueList": { + "valueReferencePairs": [ + { + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + } + }, + { + "value": "http://acplt.org/ValueId/ExampleValueId2", + "valueId": { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId2" + } + ], + "type": "GlobalReference" + } + } + ] + }, + "definition": [ + { + "language": "de", + "text": "Dies ist eine Data Specification für Testzwecke" + }, + { + "language": "en-us", + "text": "This is a DataSpecification for testing purposes" + } + ], + "levelType": "Max", + "preferredName": [ + { + "language": "de", + "text": "Test Specification" + }, + { + "language": "en-us", + "text": "TestSpecification" + } + ], + "shortName": [ + { + "language": "de", + "text": "Test Spec" + }, + { + "language": "en-us", + "text": "TestSpec" + } + ] + } + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int", + "kind": "ConceptQualifier" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int", + "kind": "ConceptQualifier" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + ], + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + }, + { + "modelType": "Entity", + "kind": "Instance", + "entityType": "SelfManagedEntity", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example bill of material submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "ModelReference" + }, + "annotations": [ + { + "modelType": "Property", + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "PARAMETER", + "idShort": "ExampleProperty3" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty3", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty1", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "direction": "INPUT", + "state": "ON", + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "INPUT", + "state": "ON" + }, + { + "modelType": "SubmodelElementList", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example ExampleSubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel ExampleSubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MultiLanguageProperty-Element" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "file:///TestFile.pdf", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Template", + "id": "https://acplt.org/Test_Submodel_Mandatory", + "idShort": "Test_Submodel_Mandatory", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + } + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelElementCollection" + }, + { + "type": "Blob", + "value": "ExampleBlob" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + } + }, + { + "modelType": "Operation", + "kind": "Template", + "idShort": "ExampleOperation" + }, + { + "modelType": "Capability", + "kind": "Instance", + + "idShort": "ExampleCapability" + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListUnordered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "idShort": "ExampleBasicEvent", + "direction": "OUTPUT", + "state": "OFF" + }, + { + "modelType": "SubmodelElementList", + "kind": "Instance", + + "idShort": "ExampleSubmodelElementListUnordered", + "orderRelevant": false, + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "valueType": "xs:string", + "idShort": "ExampleProperty" + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + "category": "VARIABLE", + "idShort": "ExampleMultiLanguageProperty" + }, + { + "modelType": "Range", + "kind": "Instance", + "category": "VARIABLE", + "valueType": "xs:int", + "idShort": "ExampleRange" + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "idShort": "ExampleSubmodelElementCollection", + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + "category": "VARIABLE", + "contentType": "application/pdf", + "idShort": "ExampleBlob" + }, + { + "modelType": "File", + "kind": "Instance", + "category": "VARIABLE", + "contentType": "application/pdf", + "idShort": "ExampleFile" + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + "category": "VARIABLE", + "idShort": "ExampleReferenceElement" + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + "idShort": "ExampleSubmodelElementCollection2" + } + ] + }, + { + "modelType": "Submodel", + "kind": "Instance", + "id": "https://acplt.org/Test_Submodel2_Mandatory", + "idShort": "Test_Submodel2_Mandatory" + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Missing", + "idShort": "TestSubmodelMissing", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "ModelReference" + }, + "annotations": [ + { + "modelType": "Property", + "kind": "Instance", + "category": "VARIABLE", + "value": "some example annotation", + "valueType": "xs:string", + "category": "PARAMETER", + "idShort": "ExampleProperty" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty3", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty1", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty2", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "kind": "Instance", + + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementList", + "value": "ExampleSubmodelElementListOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "direction": "INPUT", + "state": "ON", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "INPUT", + "state": "ON" + }, + { + "kind": "Instance", + + "modelType": "SubmodelElementList", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string", + "kind": "ConceptQualifier" + } + ], + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MultiLanguageProperty-Element" + } + ], + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + }, + { + "modelType": "Range", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Instance", + + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "kind": "Instance", + + "contentType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "kind": "Instance", + "contentType": "application/pdf", + "value": "file:///TestFile.pdf", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "value": { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelElementCollection" + }, + { + "type": "File", + "value": "ExampleFile" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + }, + { + "modelType": "Submodel", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Template", + "idShort": "TestSubmodelTemplate", + "submodelElements": [ + { + "modelType": "RelationshipElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + + }, + { + "modelType": "AnnotatedRelationshipElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "second": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "description": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + }, + { + "modelType": "Operation", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleOperation", + "inoutputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "inputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "outputVariables": [ + { + "value": + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + } + } + ], + "description": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + + }, + { + "modelType": "Capability", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleCapability", + "description": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + + }, + { + "modelType": "BasicEventElement", + "observed": + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Template" + }, + { + "type": "Operation", + "value": "ExampleOperation" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "ModelReference" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBasicEvent", + "direction": "OUTPUT", + "state": "OFF", + "description": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ], + "direction": "OUTPUT", + "state": "OFF" + }, + { + "modelType": "SubmodelElementList", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementListOrdered", + "orderRelevant": true, + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "typeValueListElement": "SubmodelElement", + "value": [ + { + "modelType": "Property", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "CONSTANT", + "idShort": "ExampleProperty", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + + }, + { + "modelType": "MultiLanguageProperty", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "CONSTANT", + "idShort": "ExampleMultiLanguageProperty", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + }, + { + "modelType": "Range", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "min": "0", + "valueType": "xs:int", + "category": "PARAMETER", + "idShort": "ExampleRange2", + "description": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "value": [ + { + "modelType": "Blob", + "contentType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleBlob", + "description": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + + }, + { + "modelType": "File", + "contentType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleFile", + "description": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + + }, + { + "modelType": "ReferenceElement", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleReferenceElement", + "description": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + + } + ] + }, + { + "modelType": "SubmodelElementCollection", + "kind": "Template", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "GlobalReference" + }, + "category": "PARAMETER", + "idShort": "ExampleSubmodelElementCollection2", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ] + + } + ], + "description": [ + { + "language": "en-us", + "text": "An example submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" + } + ] + + } + ] +} diff --git a/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json b/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json new file mode 100644 index 000000000..16a24778e --- /dev/null +++ b/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json @@ -0,0 +1,3135 @@ + +{ + "assetAdministrationShells": [ + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset" + } + ], + "type": "GlobalReference" + } + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "GlobalReference" + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell", + "idShort": "TestAssetAdministrationShell", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + } + ], + "type": "GlobalReference" + }, + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel2_Mandatory" + } + ], + "type": "GlobalReference" + } + ], + "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", + "idShort": "Test_AssetAdministrationShell_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Mandatory" + } + ], + "type": "GlobalReference" + } + }, + "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", + "idShort": "Test_AssetAdministrationShell2_Mandatory" + }, + { + "modelType": "AssetAdministrationShell", + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId": + { + "keys": [ + { + + "type": "AssetAdministrationShell", + "value": "https://acplt.org/Test_Asset_Missing" + } + ], + "type": "GlobalReference" + } + }, + "submodels": [ + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + } + ], + "type": "GlobalReference" + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", + "idShort": "TestAssetAdministrationShell", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + } + ], + "conceptDescriptions": [ + { + "modelType": "ConceptDescription", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription", + "idShort": "TestConceptDescription", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription" + } + ], + "type": "GlobalReference" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "ConceptDescription", + "id": "https://acplt.org/Test_ConceptDescription_Mandatory", + "idShort": "Test_ConceptDescription_Mandatory" + }, + { + "modelType": "ConceptDescription", + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_ConceptDescription_Missing", + "idShort": "TestConceptDescription1", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "ConceptDescription", + "embeddedDataSpecifications": [ + { + "dataSpecification": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0" + } + ], + "type": "GlobalReference" + }, + "dataSpecificationContent": + { + "dataType": "RealMeasure", + "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", + "symbol": "SU", + "unit": "SpaceUnit", + "unitId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Units/SpaceUnit" + } + ], + "type": "GlobalReference" + }, + "value": "TEST", + "valueFormat": "xs:string", + "valueList": + { + "valueReferencePairTypes": [ + { + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + } + }, + { + "value": "http://acplt.org/ValueId/ExampleValueId2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId2" + } + ], + "type": "GlobalReference" + } + } + ] + }, + "definition": [ + { + "language": "de", + "text": "Dies ist eine Data Specification für Testzwecke" + }, + { + "language": "en-us", + "text": "This is a DataSpecification for testing purposes" + } + ], + "levelType": ["Min", "Max"], + "preferredName": [ + { + "language": "de", + "text": "Test Specification" + }, + { + "language": "en-us", + "text": "TestSpecification" + } + ], + "shortNames": [ + { + "language": "de", + "text": "Test Spec" + }, + { + "language": "en-us", + "text": "TestSpec" + } + ] + } + } + ], + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/DataSpecifciations/Example/Identification", + "idShort": "TestSpec_01", + "isCaseOf": [ + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" + } + ], + "type": "GlobalReference" + } + ] + } + ], + "submodels": [ + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": "Qualifier", + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "Int" + }, + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "Int" + } + ], + "idShort": "ManufacturerName", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "value": "978-8234-234-342", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "idShort": "InstanceId", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "version": "0.9" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", + "idShort": "BillOfMaterial", + "submodelElements": [ + { + "modelType": "Entity", + "entityType": "CoManagedEntity", + "statements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValue2", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValue2" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + ], + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + }, + { + "modelType": + { + "name": "Entity" + }, + "entityType": "SelfManagedEntity", + "globalAssetId": + { + "keys": [ + { + + "type": "Asset", + "value": "https://acplt.org/Test_Asset2" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleEntity2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + }, + { + "type": "Entity", + "value": "ExampleEntity" + }, + { + "type": "Property", + "value": "ExampleProperty2" + } + ], + "type": "GlobalReference" + }, + "annotation": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "Parameter", + "idShort": "ExampleProperty3" + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty3", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty1", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty2", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "http://acplt.org/ValueId/ExampleValueId", + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleValueId" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "valueId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MulitLanguageProperty-Element" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "value": "/TestFile.pdf", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + }, + { + "idType": "IdShort", + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "idType": "IdShort", + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Template", + "id": "https://acplt.org/Test_Submodel_Mandatory", + "idShort": "Test_Submodel_Mandatory", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "idShort": "ExampleOperation" + }, + { + "modelType": + { + "name": "Capability" + }, + "idShort": "ExampleCapability" + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Mandatory" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "idShort": "ExampleBasicEvent" + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "valueType": "xs:string", + "idShort": "ExampleProperty" + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "idShort": "ExampleMultiLanguageProperty" + }, + { + "modelType": + { + "name": "Range" + }, + "valueType": "Int", + "idShort": "ExampleRange" + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionUnordered", + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "idShort": "ExampleBlob" + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "idShort": "ExampleFile" + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "idShort": "ExampleReferenceElement" + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "idShort": "ExampleSubmodelCollectionUnordered2" + } + ] + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "id": "https://acplt.org/Test_Submodel2_Mandatory", + "idShort": "Test_Submodel2_Mandatory" + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Instance", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Missing", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "MultiLanguageProperty", + "value": "ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "annotation": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Instance", + "value": "some example annotation", + "valueType": "xs:string", + "category": "Parameter", + "idShort": "ExampleProperty" + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty3", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty1", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty2", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "value": "exampleValue", + "valueType": "xs:string", + "qualifiers": [ + { + "modelType": + { + "name": "Qualifier" + }, + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "valueType": "xs:string" + } + ], + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "value": [ + { + "language": "en-us", + "text": "Example value of a MultiLanguageProperty element" + }, + { + "language": "de", + "text": "Beispielswert für ein MulitLanguageProperty-Element" + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "value": "AQIDBAU=", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "value": "/TestFile.pdf", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "value": + { + "keys": [ + { + + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel_Missing" + }, + { + "idType": "IdShort", + "type": "SubmodelElementCollection", + "value": "ExampleSubmodelCollectionOrdered" + }, + { + "idType": "IdShort", + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + }, + { + "modelType": + { + "name": "Submodel" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" + } + ], + "type": "GlobalReference" + }, + "administration": + { + "revision": "0", + "version": "0.9" + }, + "id": "https://acplt.org/Test_Submodel_Template", + "idShort": "TestSubmodel", + "submodelElements": [ + { + "modelType": + { + "name": "RelationshipElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleRelationshipElement", + "first": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example RelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel RelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "AnnotatedRelationshipElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleAnnotatedRelationshipElement", + "first": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "second": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example AnnotatedRelationshipElement object" + }, + { + "language": "de", + "text": "Beispiel AnnotatedRelationshipElement Element" + } + ] + } + }, + { + "modelType": + { + "name": "Operation" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Operations/ExampleOperation" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleOperation", + "inoutputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "inputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], + "outputVariable": [ + { + "value": + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + } + } + ], +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Operation object" + }, + { + "language": "de", + "text": "Beispiel Operation Element" + } + ] + } + }, + { + "modelType": + { + "name": "Capability" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Capabilities/ExampleCapability" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleCapability", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Capability object" + }, + { + "language": "de", + "text": "Beispiel Capability Element" + } + ] + } + }, + { + "modelType": + { + "name": "BasicEventElement" + }, + "observed": + { + "keys": [ + { + "type": "Property", + "value": "ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Events/ExampleBasicEvent" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBasicEvent", +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example BasicEvent object" + }, + { + "language": "de", + "text": "Beispiel BasicEvent Element" + } + ] + } + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionOrdered", + "ordered": true, +"description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionOrdered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Property" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "GlobalReference" + }, + "valueType": "xs:string", + "category": "Constant", + "idShort": "ExampleProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ] + } + }, + { + "modelType": + { + "name": "MultiLanguageProperty" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "GlobalReference" + }, + "category": "Constant", + "idShort": "ExampleMultiLanguageProperty", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example MulitLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MulitLanguageProperty Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "max": "100", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + }, + { + "modelType": + { + "name": "Range" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "GlobalReference" + }, + "min": "0", + "valueType": "Int", + "category": "Parameter", + "idShort": "ExampleRange2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + }, + "value": [ + { + "modelType": + { + "name": "Blob" + }, + "mimeType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Blobs/ExampleBlob" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleBlob", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Blob object" + }, + { + "language": "de", + "text": "Beispiel Blob Element" + } + ] + } + }, + { + "modelType": + { + "name": "File" + }, + "mimeType": "application/pdf", + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/Files/ExampleFile" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleFile", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example File object" + }, + { + "language": "de", + "text": "Beispiel File Element" + } + ] + } + }, + { + "modelType": + { + "name": "ReferenceElement" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleReferenceElement", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example Reference Element object" + }, + { + "language": "de", + "text": "Beispiel Reference Element Element" + } + ] + } + } + ] + }, + { + "modelType": + { + "name": "SubmodelElementCollection" + }, + "kind": "Template", + "semanticId": + { + "keys": [ + { + + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" + } + ], + "type": "GlobalReference" + }, + "category": "Parameter", + "idShort": "ExampleSubmodelCollectionUnordered2", + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollectionUnordered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollectionUnordered Element" + } + ] + } + } + ], + "description": { + "langStrings": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ] + } + } + ] +} From 2bdb3bba68a36008dd677050d8ef39419f5d005c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 11:08:11 +0200 Subject: [PATCH 06/91] Create dataformat-rdf project --- dataformat-rdf/pom.xml | 45 + .../v3/dataformat/rdf/FallbackSerializer.java | 43 + .../v3/dataformat/rdf/IgnoreTypeMixIn.java | 23 + .../aas4j/v3/dataformat/rdf/JsonLDModule.java | 53 + .../v3/dataformat/rdf/JsonLDSerializer.java | 197 +++ .../rdf/JsonLDSerializerModifier.java | 45 + .../dataformat/rdf/JsonLdEnumSerializer.java | 89 ++ .../dataformat/rdf/LangStringSerializer.java | 54 + .../aas4j/v3/dataformat/rdf/Parser.java | 1171 +++++++++++++++++ .../aas4j/v3/dataformat/rdf/Serializer.java | 309 +++++ .../v3/dataformat/rdf/UriSerializer.java | 54 + .../rdf/custom/BigDecimalSerializer.java | 43 + .../rdf/custom/JsonLdEnumMixin.java | 24 + .../rdf/custom/LangStringMixin.java | 36 + .../rdf/custom/ReflectiveMixInResolver.java | 42 + .../XMLGregorianCalendarDeserializer.java | 50 + .../XMLGregorianCalendarSerializer.java | 48 + .../AdministrativeInformationMixin.java | 39 + .../AnnotatedRelationshipElementMixin.java | 34 + .../mixins/AssetAdministrationShellMixin.java | 48 + .../rdf/mixins/AssetInformationMixin.java | 61 + .../rdf/mixins/BasicEventElementMixin.java | 80 ++ .../v3/dataformat/rdf/mixins/BlobMixin.java | 39 + .../rdf/mixins/CapabilityMixin.java | 28 + .../rdf/mixins/ConceptDescriptionMixin.java | 34 + .../rdf/mixins/DataElementMixin.java | 38 + .../mixins/DataSpecificationContentMixin.java | 34 + .../DataSpecificationIEC61360Mixin.java | 107 ++ .../DataSpecificationPhysicalUnitMixin.java | 100 ++ .../EmbeddedDataSpecificationMixin.java | 45 + .../v3/dataformat/rdf/mixins/EntityMixin.java | 55 + .../rdf/mixins/EnvironmentMixin.java | 48 + .../rdf/mixins/EventElementMixin.java | 34 + .../rdf/mixins/EventMessageMixin.java | 28 + .../dataformat/rdf/mixins/ExtensionMixin.java | 51 + .../v3/dataformat/rdf/mixins/FileMixin.java | 39 + .../dataformat/rdf/mixins/FormulaMixin.java | 34 + .../rdf/mixins/HasDataSpecificationMixin.java | 50 + .../rdf/mixins/HasExtensionsMixin.java | 34 + .../dataformat/rdf/mixins/HasKindMixin.java | 40 + .../rdf/mixins/HasSemanticsMixin.java | 50 + .../rdf/mixins/IdentifiableMixin.java | 48 + .../mixins/IdentifierKeyValuePairMixin.java | 45 + .../rdf/mixins/IdentifierMixin.java | 32 + .../v3/dataformat/rdf/mixins/KeyMixin.java | 40 + .../mixins/MultiLanguagePropertyMixin.java | 41 + .../rdf/mixins/ObjectAttributesMixin.java | 34 + .../dataformat/rdf/mixins/OperationMixin.java | 45 + .../rdf/mixins/OperationVariableMixin.java | 33 + .../rdf/mixins/PolicyDecisionPointMixin.java | 33 + .../mixins/PolicyEnforcementPointsMixin.java | 33 + .../mixins/PolicyInformationPointsMixin.java | 40 + .../dataformat/rdf/mixins/PropertyMixin.java | 45 + .../rdf/mixins/QualifiableMixin.java | 41 + .../dataformat/rdf/mixins/QualifierMixin.java | 51 + .../v3/dataformat/rdf/mixins/RangeMixin.java | 45 + .../dataformat/rdf/mixins/ReferableMixin.java | 59 + .../rdf/mixins/ReferenceElementMixin.java | 33 + .../dataformat/rdf/mixins/ReferenceMixin.java | 42 + .../rdf/mixins/RelationshipElementMixin.java | 44 + .../dataformat/rdf/mixins/ResourceMixin.java | 41 + .../rdf/mixins/SpecificAssetIdMixin.java | 48 + .../rdf/mixins/SubjectAttributesMixin.java | 34 + .../SubmodelElementCollectionMixin.java | 46 + .../rdf/mixins/SubmodelElementListMixin.java | 62 + .../rdf/mixins/SubmodelElementMixin.java | 41 + .../dataformat/rdf/mixins/SubmodelMixin.java | 34 + .../dataformat/rdf/mixins/ValueListMixin.java | 37 + .../rdf/mixins/ValueReferencePairMixin.java | 39 + .../v3/dataformat/rdf/mixins/ViewMixin.java | 34 + .../rdf/preprocessing/BasePreprocessor.java | 54 + .../rdf/preprocessing/JsonPreprocessor.java | 43 + .../preprocessing/TypeNamePreprocessor.java | 195 +++ .../aas4j/v3/dataformat/rdf/ParserTest.java | 154 +++ .../v3/dataformat/rdf/SerializerTest.java | 101 ++ .../v3/dataformat/rdf/SerializerUtil.java | 46 + dataformat-rdf/src/test/resources/AASFull.ttl | 354 +++++ .../resources/AAS_Reference_shortExample.nt | 16 + .../resources/AAS_Reference_shortExample.ttl | 27 + .../AssetAdministrationShell_Example.ttl | 56 + .../src/test/resources/Complete_Example.ttl | 347 +++++ .../src/test/resources/Overall-Example.nt | 253 ++++ .../src/test/resources/ReferenceExample.ttl | 18 + .../Submodel_SubmodelElement_Example.ttl | 137 ++ .../Submodel_SubmodelElement_shortExample.nt | 25 + .../Submodel_SubmodelElement_shortExample.ttl | 42 + .../resources/example-from-serializer.jsonld | 88 ++ 87 files changed, 6632 insertions(+) create mode 100644 dataformat-rdf/pom.xml create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java create mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java create mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java create mode 100644 dataformat-rdf/src/test/resources/AASFull.ttl create mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt create mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl create mode 100644 dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Complete_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Overall-Example.nt create mode 100644 dataformat-rdf/src/test/resources/ReferenceExample.ttl create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt create mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl create mode 100644 dataformat-rdf/src/test/resources/example-from-serializer.jsonld diff --git a/dataformat-rdf/pom.xml b/dataformat-rdf/pom.xml new file mode 100644 index 000000000..8d65df6de --- /dev/null +++ b/dataformat-rdf/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.eclipse.digitaltwin.aas4j + dataformat-parent + ${revision} + + dataformat-rdf + Asset Administration Shell RDF-Serializer + + + + ${groupId} + dataformat-core + ${revision} + + + ${groupId} + dataformat-core + ${revision} + tests + test + + + org.apache.jena + jena-arq + ${jena.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + test + + + pl.pragmatists + JUnitParams + ${junit-params.version} + test + + + diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java new file mode 100644 index 000000000..b787d56a2 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import java.io.IOException; +import java.util.Map; + +public class FallbackSerializer extends StdSerializer> { + + + public FallbackSerializer() { + this(null); + } + + public FallbackSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(Map value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeString(value.toString()); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java new file mode 100644 index 000000000..4e42f6851 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonIgnoreType; + +@JsonIgnoreType +public class IgnoreTypeMixIn { +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java new file mode 100644 index 000000000..3e0b3699e --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.databind.module.SimpleModule; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.BigDecimalSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.math.BigDecimal; +import java.net.URI; +import java.util.Map; + + +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + * Jackson module which provides support for JSON-LD serialization + */ +public class JsonLDModule extends SimpleModule { + + + public JsonLDModule(Map idMap) { + super(); + + setSerializerModifier(new JsonLDSerializerModifier(idMap)); + + addSerializer(XMLGregorianCalendar.class, new XMLGregorianCalendarSerializer()); + addDeserializer(XMLGregorianCalendar.class, new XMLGregorianCalendarDeserializer()); + addSerializer(BigDecimal.class, new BigDecimalSerializer()); + + addSerializer(URI.class, new UriSerializer()); + addSerializer(LangString.class, new LangStringSerializer()); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java new file mode 100644 index 000000000..d59ef814d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.WritableTypeId; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.jsontype.TypeSerializer; +import com.fasterxml.jackson.databind.ser.BeanSerializer; +import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.math.BigInteger; +import java.util.*; +import java.util.stream.Stream; + + +public class JsonLDSerializer extends BeanSerializer { + + private final Logger logger = LoggerFactory.getLogger(JsonLDSerializer.class); + + private static int currentRecursionDepth = 0; + + static final Map contextItems = new HashMap<>(); + + private final Map idMap; + + JsonLDSerializer(BeanSerializerBase src, Map idMap) { + super(src); + this.idMap = Objects.requireNonNullElseGet(idMap, HashMap::new); + } + + + + @Override + public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { + gen.setCurrentValue(bean); + + currentRecursionDepth++; + gen.writeStartObject(); + + if (currentRecursionDepth == 1) { + Map filteredContext = new HashMap<>(); + filterContextWrtBean(bean, filteredContext); + gen.writeObjectField("@context", filteredContext); + //gen.writeStringField("@context", "https://jira.iais.fraunhofer.de/stash/projects/ICTSL/repos/ids-infomodel-commons/raw/jsonld-context/3.0.0/context.jsonld"); // only add @context on top level + + } + + if(idMap.containsKey(bean)) + { + gen.writeStringField("@id", idMap.get(bean)); + } + else + { + String randomUri = "https://admin-shell.io/autogen/" + bean.getClass().getSimpleName() + "/" + UUID.randomUUID(); + idMap.put(bean, randomUri); + gen.writeStringField("@id", randomUri); + } + + WritableTypeId typeIdDef = _typeIdDef(typeSer, bean, JsonToken.START_OBJECT); + String resolvedTypeId = typeIdDef.id != null ? typeIdDef.id.toString() : typeSer.getTypeIdResolver().idFromValue(bean); + if (resolvedTypeId != null) { + gen.writeStringField(typeIdDef.asProperty, resolvedTypeId); + } + if (_propertyFilterId != null) { + serializeFieldsFiltered(bean, gen, provider); + } else { + serializeFields(bean, gen, provider); + } + gen.writeEndObject(); + currentRecursionDepth--; + } + + + private void filterContextWrtBean(Object bean, Map filteredContext) { + //Some default entries for AAS + filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); + //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); + + if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion + + //Check if RdfResource or TypedLiteral is used. They contain a field called "type" which can reference to any namespace + //Therefore it is vital to also check the value of the type field for prefixes that need to be included in the context + if(bean.getClass().getSimpleName().equals("LangString")) + { + //LangString is of type rdf:langString, so this must be present + filteredContext.put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + } + contextItems.forEach((p, u) -> { + JsonTypeName typeNameAnnotation = bean.getClass().getAnnotation(JsonTypeName.class); + if(typeNameAnnotation != null && typeNameAnnotation.value().contains(p)) { + filteredContext.put(p, u); + } + Stream.of(bean.getClass().getMethods()).forEach(m -> { + JsonProperty propertyAnnotation = m.getAnnotation(JsonProperty.class); + if(propertyAnnotation != null && propertyAnnotation.value().contains(p)) { + filteredContext.put(p, u); + } + }); + }); + Stream.of(bean.getClass().getMethods()).forEach(m -> { + // run though all properties and check annotations. These annotations should contain the prefixes + JsonProperty prop = m.getAnnotation(JsonProperty.class); + if(prop != null) + { + for(Map.Entry entry : contextItems.entrySet()) + { + if(prop.value().startsWith(entry.getKey())) + { + filteredContext.put(entry.getKey(), entry.getValue()); + break; + } + } + } + }); + // run through fields recursively + for(Field f : getAllFields(new HashSet<>(), bean.getClass())) { + + if(Collection.class.isAssignableFrom(f.getType())) + { + try { + if(f.getType().getName().startsWith("java.") && !f.getType().getName().startsWith("java.util")) continue; + boolean accessible = f.isAccessible(); + f.setAccessible(true); + Collection c = (Collection) f.get(bean); + if(c == null) { + continue; + } + for(Object o : c) + { + filterContextWrtBean(o, filteredContext); + } + f.setAccessible(accessible); + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + if (f.getType().isPrimitive() || f.getType().isEnum() || f.getType().isArray() + || f.getType().getName().contains("java.") + || f.getType().getName().contains("javax.")) continue; + + try { + boolean wasAccessible = f.isAccessible(); + f.setAccessible(true); + filterContextWrtBean(f.get(bean), filteredContext); + f.setAccessible(wasAccessible); + } catch (IllegalAccessException ignored) { + //logger.error("setting accessible failed"); //We can catch that here, as IllegalReflectiveAccess cannot occur on our own packages + } + + //f.trySetAccessible(wasAccessible); + + } + + } + + /** + * This function retrieves a set of all available fields of a class, including inherited fields + * @param fields Set to which discovered fields will be added. An empty HashSet should do the trick + * @param type The class for which fields should be discovered + * @return set of all available fields + */ + private static Set getAllFields(Set fields, Class type) { + fields.addAll(Arrays.asList(type.getDeclaredFields())); + + if (type.getSuperclass() != null) { + getAllFields(fields, type.getSuperclass()); + } + + return fields; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java new file mode 100644 index 000000000..d998ac5c9 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import com.fasterxml.jackson.databind.BeanDescription; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializationConfig; +import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; +import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; + +import java.util.Map; + + +public class JsonLDSerializerModifier extends BeanSerializerModifier { + + private final Map idMap; + + public JsonLDSerializerModifier(Map idMap) { + this.idMap = idMap; + } + + @Override + public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer serializer) { + if (serializer instanceof BeanSerializerBase) { + return new JsonLDSerializer((BeanSerializerBase) serializer, idMap); + } else { + return serializer; + } + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java new file mode 100644 index 000000000..bbcf27772 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.io.IOException; + +public class JsonLdEnumSerializer extends JsonSerializer> { + + + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + //Generated Enum classes of the admin shell have @IRI annotations, which need to be used to provide proper RDF + if(value.getClass().isEnum() && value.getClass().getName().startsWith("org.eclipse.digitaltwin.aas4j.")) + { + //Try to get annotation value to get the IRI used in the ontology + if(value.getClass().getAnnotation(IRI.class) != null && value.getClass().getAnnotation(IRI.class).value().length > 0) + { + gen.writeStartObject(); + gen.writeStringField("@type", value.getClass().getAnnotation(IRI.class).value()[0]); + + //Try to extract exact IRI of the enum value, if present + try { + var annotation = value.getClass().getField(value.name()).getAnnotation(IRI.class); + if(annotation != null && annotation.value().length > 0) + { + gen.writeStringField("@id", annotation.value()[0]); + } + else + { + //Didn't find an @IRI annotation - fall back to using class annotation + field name + gen.writeStringField("@id", translate(value.getClass(), value.name())); + } + } + //Should be impossible + catch (NoSuchFieldException e) + { + //Didn't find an @IRI annotation - fall back to using class annotation + field name + gen.writeStringField("@id", translate(value.getClass(), value.name())); + } + gen.writeEndObject(); + } + else + { + gen.writeString(translate(value.getClass(), value.name())); + } + + + } else { + provider.findValueSerializer(Enum.class).serialize(value, gen, provider); + } + } + + + + public static String translate(Class enumClass, String input) { + String[] iriValues = enumClass.getAnnotation(IRI.class).value(); + String result = ""; + if(iriValues.length > 0) + { + result = iriValues[0]; + if(!result.endsWith("/")) + { + result += "/"; + } + } + result += input; + return result; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java new file mode 100644 index 000000000..53a03bb85 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import java.io.IOException; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringSerializer extends StdSerializer { + + + public LangStringSerializer() { + this(null); + } + + public LangStringSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(LangString value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeStartObject(); + if(value.getLanguage() != null && !value.getLanguage().isEmpty()) + { + gen.writeStringField("@language", value.getLanguage()); + } + else + { + gen.writeStringField("@type", "rdf:langString"); + } + gen.writeStringField("@value", value.getText()); + gen.writeEndObject(); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java new file mode 100644 index 000000000..80582d6b5 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java @@ -0,0 +1,1171 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; +import org.apache.jena.datatypes.DatatypeFormatException; +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.*; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; +import org.apache.jena.riot.RiotException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.lang.reflect.*; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * Internal class to handle the parsing of JSON-LD into java objects + * @author maboeckmann + */ +class Parser { + + private final Logger logger = LoggerFactory.getLogger(Parser.class); + + private static final URI blankNodeIdPropertyUri = URI.create("https://admin-shell.io/aas/blankNodeId"); + + static Map knownNamespaces = new HashMap<>(); + + /** + * Main internal method for creating a java object from a given RDF graph and a URI of the object to handle + * @param inputModel Model on which queries are to be evaluated from which information can be retrieved + * @param objectUri URI of the object to be handled + * @param targetClass Variable containing the class which should be returned + * @param Class which should be returned + * @return Object of desired class, filled with the values extracted from inputModel + * @throws IOException thrown if the parsing fails + */ + private T handleObject(Model inputModel, String objectUri, Class targetClass) throws IOException { + try { + + //if(!targetClass.getSimpleName().endsWith("Impl")) //This would not work for "TypedLiteral", "RdfResource" and so on + //Check whether we are dealing with an instantiable class (i.e. no interface and no abstract class) + boolean currentObjectIsBlankNode = false; + if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { + //We don't know the desired class yet (current targetClass is not instantiable). This is only known for the root object + ArrayList> implementingClasses = getImplementingClasses(targetClass); + String queryString; + //Get a list of all "rdf:type" statements in our model + //In case of a blank node, the "object URI" will just be a string and no valid URI. In that case, we need a different query syntax + try { + new URL(objectUri); + } + catch (MalformedURLException e) + { + currentObjectIsBlankNode = true; + } + if(currentObjectIsBlankNode) + { + //Object is a blank node, so the subject URI cannot be used + queryString = "SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> \"" + objectUri + "\" ; a ?type . }"; + } + else + { + //Not a blank node, so we can work with the subject URI + queryString = "SELECT ?type { BIND(<" + objectUri + "> AS ?s). ?s a ?type . }"; + } + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); + ResultSet resultSet = queryExecution.execSelect(); + + if (!resultSet.hasNext()) { + queryExecution.close(); + throw new IOException("Could not extract class of child object. ID: " + objectUri); + } + + //Class candidateClass = null; + + String fullName = "No triple present indicating type."; + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + fullName = solution.get("type").toString(); + + //Expected URI is something like https://w3id.org/idsa/core/ClassName (and we want ClassName) + String className = fullName.substring(fullName.lastIndexOf('/') + 1); + + //Some namespaces use "#" instead of "/" + if (className.contains("#")) { + className = className.substring(className.lastIndexOf("#") + 1); + } + + for (Class currentClass : implementingClasses) { + //Is this class instantiable? + if (!currentClass.isInterface() && !Modifier.isAbstract(currentClass.getModifiers())) { + //candidateClass = currentClass; + if (currentClass.getSimpleName().equals(className) || currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { + targetClass = (Class) currentClass; + break; + } + } + } + } + queryExecution.close(); + //Did we find "the" class, i.e. instantiable and name matches? + if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { + //No, the current targetClass cannot be instantiated. Do we have a candidate class? + //if (candidateClass != null) { + throw new IOException("Did not find an instantiable class for " + objectUri + " matching expected class name (" + targetClass.getSimpleName() + "). Object has type: " + fullName); + //targetClass = (Class) candidateClass; + //} + } + } + + //Enums have no constructors + if(targetClass.isEnum()) + { + return handleEnum(targetClass, objectUri); + } + + //Get constructor (which is package private for our classes) and make it accessible + Constructor constructor = targetClass.getDeclaredConstructor(); + constructor.setAccessible(true); + + //Instantiate new object, which will be returned at the end + T returnObject = constructor.newInstance(); + + //Get methods + Method[] methods = returnObject.getClass().getDeclaredMethods(); + + //Store methods in map. Key is the name of the RDF property without ids prefix + Map methodMap = new HashMap<>(); + + //Get all relevant methods (setters, but not for label, comment or external properties) + Arrays.stream(methods).filter(method -> { + String name = method.getName(); + //Filter out irrelevant methods + return name.startsWith("set") && !name.equals("setProperty") && !name.equals("setComment") && !name.equals("setLabel"); // && !name.equals("setId"); + }).forEach(method -> { + //Remove "set" part + String reducedName = method.getName().substring(3); + + //Turn first character to lower case + char[] c = reducedName.toCharArray(); + c[0] = Character.toLowerCase(c[0]); + String finalName = new String(c); + methodMap.put(finalName, method); + + }); + + //There is no "setId" method in our CodeGen generated classes, so we get the field + /* TODO: No "id" field yet + Field idField = returnObject.getClass().getDeclaredField("id"); + + //Store whether or not it was accessible, so that we can undo making it accessible + boolean wasAccessible = idField.isAccessible(); + idField.setAccessible(true); + + //Set the ID of the object to be identical with the objectUri parameter + idField.set(returnObject, new URI(objectUri)); + idField.setAccessible(wasAccessible); + */ + + //Is this a trivial class with 0 fields? If so, the generated query would be "SELECT { }", which is illegal + if(methodMap.isEmpty()) + { + return returnObject; + } + + + //A list which stores all those parameter names which may occur only once (i.e. those occurring in the GROUP BY clause) + List groupByKeys = new ArrayList<>(); + + StringBuilder queryStringBuilder = new StringBuilder(); + + for(Map.Entry entry : knownNamespaces.entrySet()) + { + queryStringBuilder.append("PREFIX ").append(entry.getKey()); + if(!entry.getKey().endsWith(":")) + { + queryStringBuilder.append(":"); + } + queryStringBuilder.append(" <").append(entry.getValue()).append(">\n"); + } + queryStringBuilder.append("SELECT"); + methodMap.forEach((key1, value) -> { + //Is the return type some sort of List? + if (Collection.class.isAssignableFrom(value.getParameterTypes()[0])) { + boolean isTypedLiteral = false; + //Yes, it is assignable multiple times. Concatenate multiple values together using some delimiter + try { + //ArrayLists are generics. We need to extract the name of the generic parameter as string and interpret that + String typeName = extractTypeNameFromCollection(value.getGenericParameterTypes()[0]); + + if (typeName.endsWith("LangString")) + isTypedLiteral = true; + } catch (IOException e) { + e.printStackTrace(); + } + if (isTypedLiteral) { + queryStringBuilder.append(" (GROUP_CONCAT(CONCAT('\"',?").append(key1).append(",'\"@', lang(?").append(key1).append("));separator=\"||\") AS ?").append(key1).append("sLang) "); + } + queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append(";separator=\"||\") AS ?").append(key1).append("s) "); + + //Additional case for blank nodes + queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append("Blank;separator=\"||\") AS ?").append(key1).append("sBlank) "); + + + } else { + //No, it's not a list. No need to aggregate + queryStringBuilder.append(" ?").append(key1); + //We will have to GROUP BY this variable though... + groupByKeys.add(key1); + } + }); + //Start the "WHERE" part - Fuseki does not expect the "WHERE" keyword, but just an "{" + queryStringBuilder.append(" { "); + + //In case of blank nodes, we can't work with the subject URI + if(currentObjectIsBlankNode) + { + queryStringBuilder.append("?s <").append(blankNodeIdPropertyUri).append("> \"").append(objectUri).append("\" ;"); + } + else + { + queryStringBuilder.append(" <").append(objectUri).append(">"); + } + + //Make sure that the object is of the correct type + //This is particularly relevant in case of all fields being optional -- then one could simply parse a random object + queryStringBuilder.append(" a ").append(wrapIfUri(targetClass.getAnnotation(IRI.class).value()[0])).append(". "); + + for (Map.Entry entry : methodMap.entrySet()) { + //Is this a field which is annotated by NOT NULL? + //Attempt to find a field matching the setter method name + //E.g. for "setSomething", we search for a field with name "_something" (IDS way) and "something" + Field field = getFieldByName(targetClass, entry.getKey()); + + + //In AAS, every field is optional, as there are no validation annotations in the model + queryStringBuilder.append(" OPTIONAL {"); + + if(currentObjectIsBlankNode) + { + queryStringBuilder.append(" ?s "); + } + else { + queryStringBuilder.append(" <").append(objectUri).append("> "); //subject, as passed to the function + } + //For the field, get the JsonAlias annotation (present for all classes generated by the CodeGen tool) + //Find the annotation value containing a colon and interpret this as "prefix:predicate" + boolean foundAnnotation = false; + if(field.getAnnotation(IRI.class) != null) { + Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).map(this::wrapIfUri).filter(annotation -> annotation.contains(":")).findFirst(); + currentAnnotation.ifPresent(queryStringBuilder::append); + foundAnnotation = true; + } + if(!foundAnnotation) + { + logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); + queryStringBuilder.append("aas:").append(entry.getKey()); + } + //if(isBlank(?entry.getKey(), use value of artificial, use original value) + queryStringBuilder.append(" ?").append(entry.getKey()).append(" ."); //object + + //In case of the object being a blank node, we construct a second result variable with the blank node id + queryStringBuilder.append("OPTIONAL { ?").append(entry.getKey()).append(" <").append(blankNodeIdPropertyUri).append("> ?").append(entry.getKey()).append("Blank . } "); + + queryStringBuilder.append("} "); + } + + + queryStringBuilder.append(" } "); + + //Do we need to group? We do, if there is at least one property which can occur multiple times + //We added all those properties, which may only occur once, to the groupByKeys list + if (!groupByKeys.isEmpty()) { + queryStringBuilder.append("GROUP BY"); + for (String key : groupByKeys) { + queryStringBuilder.append(" ?").append(key); + } + } + + String queryString = queryStringBuilder.toString(); + + StringBuilder queryForOtherProperties = new StringBuilder(); + //Query for all unknown properties and their values + //Select properties and values only + + if(!targetClass.equals(LangString.class)) { //LangString has no additional properties map. Skip this step + + //CONSTRUCT { ?s ?p ?o } { ?s ?p ?o. FILTER(?p NOT IN (list of ids properties)) } + for (Map.Entry entry : knownNamespaces.entrySet()) { + queryForOtherProperties.append("PREFIX ").append(entry.getKey()); + if (!entry.getKey().endsWith(":")) { + queryForOtherProperties.append(":"); + } + queryForOtherProperties.append(" <").append(entry.getValue()).append(">\n"); + } + + + //Respect ALL properties and values + queryForOtherProperties.append(" SELECT ?p ?o { <").append(objectUri).append("> ?p ?o .\n"); + + //Exclude known properties + queryForOtherProperties.append("FILTER (?p NOT IN (rdf:type"); + + //Predicates usually look like: .append("ids:").append(entry.getKey()) + for (Map.Entry entry : methodMap.entrySet()) { + queryForOtherProperties.append(", "); + + Field field = getFieldByName(targetClass, entry.getKey()); + Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).filter(annotation -> annotation.contains(":")).filter(s -> s.length() > 1).findFirst(); + if (currentAnnotation.isPresent()) { + queryForOtherProperties.append(wrapIfUri(currentAnnotation.get())); + } else { + logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); + queryForOtherProperties.append("aas:").append(entry.getKey()); + } + } + + queryForOtherProperties.append(")). } "); + + + //Now that we searched for all "known properties", let's search for all unrecognized content and append it to a generic properties map + + Query externalPropertiesQuery = QueryFactory.create(queryForOtherProperties.toString()); + QueryExecution externalPropertiesQueryExecution = QueryExecutionFactory.create(externalPropertiesQuery, inputModel); + ResultSet externalPropertiesResultSet = externalPropertiesQueryExecution.execSelect(); + + // now as all declared instances and classes are treated, which are also represented in the respective java + // dependency, take care about the ones within foreign namespaces and add those to the 'properties' field + // note that not all models (e.g. AAS) have such methods. In case they do not exist, skip adding external properties + + try { + Method setProperty = returnObject.getClass().getDeclaredMethod("setProperty", String.class, Object.class); + Method getProperties = returnObject.getClass().getDeclaredMethod("getProperties"); + + while (externalPropertiesResultSet.hasNext()) { + QuerySolution externalPropertySolution = externalPropertiesResultSet.next(); + + HashMap currentProperties = (HashMap) getProperties.invoke(returnObject); + + //Avoid NullPointerException + if (currentProperties == null) { + currentProperties = new HashMap<>(); + } + + String propertyUri = externalPropertySolution.get("p").toString(); + + //Does this key already exist? If yes, we need to store the value as array to not override them + if (currentProperties.containsKey(propertyUri)) { + //If it is not an array list yet, turn it into one + if (!(currentProperties.get(propertyUri) instanceof ArrayList)) { + ArrayList newList = new ArrayList<>(); + newList.add(currentProperties.get(propertyUri)); + currentProperties.put(propertyUri, newList); + } + } + + //Literals and complex objects need to be handled differently + //Literals can be treated as flat values, whereas complex objects require recursive calls + if (externalPropertySolution.get("o").isLiteral()) { + Object o = handleForeignLiteral(externalPropertySolution.getLiteral("o")); + //If it is already an ArrayList, add new value to it + if (currentProperties.containsKey(propertyUri)) { + ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); + currentPropertyArray.add(o); + setProperty.invoke(returnObject, propertyUri, currentPropertyArray); + } + //Otherwise save as new plain value + else { + setProperty.invoke(returnObject, propertyUri, o); + } + } else { + //It is a complex object. Distinguish whether or not we need to store as array + HashMap subMap = handleForeignNode(externalPropertySolution.getResource("o"), new HashMap<>(), inputModel); + subMap.put("@id", externalPropertySolution.getResource("o").getURI()); + if (currentProperties.containsKey(propertyUri)) { + ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); + currentPropertyArray.add(subMap); + setProperty.invoke(returnObject, propertyUri, currentPropertyArray); + } else { + setProperty.invoke(returnObject, propertyUri, subMap); + } + } + } + externalPropertiesQueryExecution.close(); + } + catch (NoSuchMethodException ignored) + { + //Method does not exist, skip + } + } + + + + Query query; + try { + query = QueryFactory.create(queryString); + } + catch (QueryParseException e) + { + logger.error(queryString); + throw e; + } + + //Evaluate query + QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); + ResultSet resultSet = queryExecution.execSelect(); + + + if (!resultSet.hasNext()) { + queryExecution.close(); + //no content... + return returnObject; + } + + //SPARQL binding present, iterate over result and construct return object + while (resultSet.hasNext()) { + QuerySolution querySolution = resultSet.next(); + + //Check if there are fields which have more values than allowed + if (resultSet.hasNext()) { + String value1 = "", value2 = "", parameterName = ""; + QuerySolution querySolution2 = resultSet.next(); + Iterator varNamesIt = querySolution2.varNames(); + while(varNamesIt.hasNext()) + { + String varName = varNamesIt.next(); + if(querySolution.contains(varName)) + { + if(!querySolution.get(varName).equals(querySolution2.get(varName))) + { + parameterName = varName; + value1 = querySolution.get(varName).toString(); + value2 = querySolution2.get(varName).toString(); + break; + } + } + } + if(!value1.isEmpty()) + { + throw new IOException(objectUri + " has multiple values for " + parameterName + ", which is not allowed. Values are: " + value1 + " and " + value2); + } + throw new IOException("Multiple bindings for SPARQL query which should only have one binding. Input contains multiple values for a field which may occur only once."); + } + + //No value occurs more often than allowed + for (Map.Entry entry : methodMap.entrySet()) { + + //What is this method setting? Get the expected parameter type and check whether it is some complex sub-object and whether this is a list + Class currentType = entry.getValue().getParameterTypes()[0]; + + String sparqlParameterName = entry.getKey(); + + if (Collection.class.isAssignableFrom(currentType)) { + sparqlParameterName += "s"; //plural form for the concatenated values + } + if(!querySolution.contains(sparqlParameterName)) + { + sparqlParameterName += "Blank"; //If not present, try to go with the option for blank nodes instead + //TODO: Note: This would not yield full results yet in case some of the values are encapsulated + // in blank nodes and some are not, for the same property + } + if (querySolution.contains(sparqlParameterName)) { + String currentSparqlBinding = querySolution.get(sparqlParameterName).toString(); + + boolean objectIsBlankNode = querySolution.get(sparqlParameterName).isResource() && querySolution.get(sparqlParameterName).asNode().isBlank(); + String blankNodeId = ""; + //If the object is a blank node, we will struggle to make follow-up queries starting at the blank node as subject + //For that case, we add some artificial identifiers here + if(objectIsBlankNode) { + blankNodeId = querySolution.get(sparqlParameterName).asNode().getBlankNodeId().toString(); + } + if (currentType.isEnum()) { + //Two possibilities: + //1: The URI of the enum value is given directly e.g. ?s ?p + //2: The URI of the enum value is encapsulated in a blank node, e.g. + // ?s ?p [ a demo:myEnum, demo:enumValue ] + if(objectIsBlankNode) + { + + Query innerEnumQuery = QueryFactory.create("SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> + \"" + blankNodeId + "\" ; a ?type } "); + QueryExecution innerEnumQueryExecution = QueryExecutionFactory.create(innerEnumQuery, inputModel); + ResultSet innerEnumQueryExecutionResultSet = innerEnumQueryExecution.execSelect(); + + //Only throw this if there is no successful execution + IOException anyIOException = null; + boolean oneSuccessfulEnumFound = false; + while(innerEnumQueryExecutionResultSet.hasNext()) + { + try { + entry.getValue().invoke(returnObject, handleEnum(currentType, innerEnumQueryExecutionResultSet.next().get("type").toString())); + oneSuccessfulEnumFound = true; + break; //Stop after the first successful execution + } + catch (IOException e) //There might be errors, if multiple types are present, see example above + { + anyIOException = e; + } + } + //If nothing worked, but something failed (i.e. there exists a problematic element, but no proper element), we throw an exception + if(anyIOException != null && !oneSuccessfulEnumFound) + throw new IOException("Could not parse Enum. ", anyIOException); + innerEnumQueryExecution.close(); + } + else { + entry.getValue().invoke(returnObject, handleEnum(currentType, currentSparqlBinding)); + } + continue; + } + + + //There is a binding. If it is a complex sub-object, we need to recursively call this function + if (Collection.class.isAssignableFrom(currentType)) { + //We are working with ArrayLists. + //Here, we need to work with the GenericParameterTypes instead to find out what kind of ArrayList we are dealing with + String typeName = extractTypeNameFromCollection(entry.getValue().getGenericParameterTypes()[0]); + if (isArrayListTypePrimitive(entry.getValue().getGenericParameterTypes()[0])) { + if (typeName.endsWith("LangString")) { + try { + currentSparqlBinding = querySolution.get(sparqlParameterName + "Lang").toString(); + } catch (NullPointerException e) { + //logger.warn("Failed to retrieve localized/typed values of " + currentSparqlBinding + ". Make sure that namespaces used in this property are known and valid. Proceeding without localized values and interpreting as string."); + //logger.warn("Query was: " + queryString); + //logger.warn("Attempted to fetch: " + sparqlParameterName + "Lang"); + } + } + ArrayList list = new ArrayList<>(); + //Two pipes were used as delimiter above + //Introduce set to deduplicate + Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); + for (String s : allElements) { + Literal literal; + //querySolution.get(sparqlParameterName). + if (s.endsWith("@")) { + s = s.substring(2, s.length() - 3); + literal = ResourceFactory.createStringLiteral(s); + } else if (s.startsWith("\\")) { + //turn something like \"my Desc 1\"@en to "my Desc 1"@en + s = s.substring(1).replace("\\\"@", "\"@"); + literal = ResourceFactory.createLangLiteral(s.substring(1, s.lastIndexOf("@") - 1), s.substring(s.lastIndexOf("@") + 1)); + } else { + literal = ResourceFactory.createPlainLiteral(s); + } + + //Is the type of the ArrayList some built in Java primitive? + + if (builtInMap.containsKey(typeName)) { + //Yes, it is. We MUST NOT call Class.forName(name)! + list.add(handlePrimitive(builtInMap.get(typeName), literal, null)); + } else { + //Not a Java primitive, we may call Class.forName(name) + list.add(handlePrimitive(Class.forName(typeName), literal, s)); + } + } + entry.getValue().invoke(returnObject, list); + } else { + //List of complex sub-objects, such as a list of Resources in a ResourceCatalog + ArrayList list = new ArrayList<>(); + Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); + for (String s : allElements) { + if (Class.forName(typeName).isEnum()) { + list.add(handleEnum(Class.forName(typeName), s)); + } else { + list.add(handleObject(inputModel, s, Class.forName(typeName))); + } + } + entry.getValue().invoke(returnObject, list); + } + } + + //Not an ArrayList of objects expected, but rather one object + else { + //Our implementation of checking for primitives (i.e. also includes URLs, Strings, XMLGregorianCalendars, ...) + if (isPrimitive(currentType)) { + + Literal literal = null; + try { + literal = querySolution.getLiteral(sparqlParameterName); + } catch (Exception ignored) { + } + + entry.getValue().invoke(returnObject, handlePrimitive(currentType, literal, currentSparqlBinding)); + + } else { + //Not a primitive object, but a complex sub-object. Recursively call this function to handle it + if (objectIsBlankNode) { + entry.getValue().invoke(returnObject, handleObject(inputModel, blankNodeId, entry.getValue().getParameterTypes()[0])); + } else { + + entry.getValue().invoke(returnObject, handleObject(inputModel, currentSparqlBinding, entry.getValue().getParameterTypes()[0])); + } + } + } + } + + } + } + queryExecution.close(); + + return returnObject; + } catch (NoSuchMethodException | NullPointerException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchFieldException | URISyntaxException | DatatypeConfigurationException | ClassNotFoundException e) { + throw new IOException("Failed to instantiate desired class (" + targetClass.getName() + ")", e); + } + } + + /** + * This function wraps a URI with "<" ">", if needed, to avoid errors about "unknown namespace http(s):" + * @param input Input URI, possibly a prefixed value + * @return If this is a full URI, starting with http or https, the URI will be encapsulated in "<" ">" + */ + private String wrapIfUri(String input) + { + if(input.startsWith("http://") || input.startsWith("https://")) + { + return "<" + input + ">"; + } + else { + return input; + } + } + + private Object handleForeignLiteral(Literal literal) throws URISyntaxException { + if(literal.getLanguage() != null && !literal.getLanguage().equals("")) + { + return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); + } + //If not, does it have some datatype URI? + //else if(literal.getDatatypeURI() != null && !literal.getDatatypeURI().equals("")) + //{ + // return new TypedLiteral(literal.getString(), new URI(literal.getDatatypeURI())); + //} + //If both is not true, add it as normal string + else + { + return literal.getString(); + } + } + + private HashMap handleForeignNode(RDFNode node, HashMap map, Model model) throws IOException, URISyntaxException { + //Make sure it is not a literal. If it were, we would not know the property name and could not add this to the map + //Literals must be handled "one recursion step above" + if(node.isLiteral()) + { + throw new IOException("Literal passed to handleForeignNode. Must be non-literal RDF node"); + } + + //Run SPARQL query retrieving all information (only one hop!) about this node + String queryString = "SELECT ?s ?p ?o { BIND(<" + node.asNode().getURI() + "> AS ?s) . ?s ?p ?o . } "; + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, model); + ResultSet resultSet = queryExecution.execSelect(); + + + + //Handle outgoing properties of this foreign node + while(resultSet.hasNext()) + { + QuerySolution querySolution = resultSet.next(); + + String propertyUri = querySolution.get("p").toString(); + + if(map.containsKey(propertyUri)) { + //If it is not an array list yet, turn it into one + if (!(map.get(propertyUri) instanceof ArrayList)) { + ArrayList newList = new ArrayList<>(); + newList.add(map.get(propertyUri)); + map.put(propertyUri, newList); + } + } + + //Check the type of object we have. If it is a literal, just add it as "flat value" to the map + if(querySolution.get("o").isLiteral()) + { + //Handle some small literal. This function will turn this into a TypedLiteral if appropriate + Object o = handleForeignLiteral(querySolution.getLiteral("o")); + if(map.containsKey(propertyUri)) + { + map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(o)); + } + else + { + map.put(querySolution.get("p").toString(), o); + } + } + + //If it is not a literal, we need to call this function recursively. Create new map for sub object + else + { + //logger.info("Calling handleForeignNode for " + querySolution.getResource("o").toString()); + if(querySolution.getResource("s").toString().equals(querySolution.getResource("o").toString())) + { + logger.warn("Found self-reference on " + querySolution.getResource("s").toString() + " via predicate " + querySolution.getResource("p").toString() + " ."); + continue; + } + HashMap subMap = handleForeignNode(querySolution.getResource("o"), new HashMap<>(), model); + subMap.put("@id", querySolution.getResource("o").getURI()); + if(map.containsKey(propertyUri)) + { + map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(subMap)); + } + else { + map.put(querySolution.get("p").toString(), subMap); + } + } + } + queryExecution.close(); + return map; + } + + + /** + * Utility function, used to obtain the field corresponding to a setter function + * @param targetClass Class object in which we search for a field + * @param fieldName Guessed name of the field to search for + * @return Field object matching the name (possibly with leading underscore) + * @throws NoSuchFieldException thrown, if no such field exists + */ + private Field getFieldByName(Class targetClass, String fieldName) throws NoSuchFieldException { + try { + return targetClass.getDeclaredField("_" + fieldName); + } catch (NoSuchFieldException e) { + try { + return targetClass.getDeclaredField(fieldName); + } catch (NoSuchFieldException e2) { + try { + return targetClass.getDeclaredField("_" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1)); + } + catch (NoSuchFieldException e3) + { + throw new NoSuchFieldException("Failed to find field which is set by method " + fieldName); + } + } + } + } + + /** + * Internal function to create a single enum object from a given desired class and a URL + * @param enumClass The enum class + * @param url The URL of the enum value + * @param Enum class + * @return Value of enumClass matching the input URL + * @throws IOException thrown if no matching enum value could be found + */ + private T handleEnum(Class enumClass, String url) throws IOException { + if (!enumClass.isEnum()) { + throw new RuntimeException("Non-Enum class passed to handleEnum function."); + } + T[] constants = enumClass.getEnumConstants(); + if(url.contains("/")) + { + url = url.substring(url.lastIndexOf("/") + 1); + } + for (T constant : constants) { + //We artificially added some underscores in the AAS ontology. TODO: This might be a bit dangerous for other ontologies, which really contain underscores in enum names + if (url.equalsIgnoreCase(constant.toString()) || url.equalsIgnoreCase(constant.toString().replace("_", ""))) { + return constant; + } + } + throw new IOException("Failed to find matching enum value for " + url + " . Available enums are: " + Arrays.stream(constants).map(Object::toString).collect(Collectors.joining(", "))); + } + + /** + * Function for handling a rather primitive object, i.e. not a complex sub-object (e.g. URI, TypedLiteral, GregorianCalendar values, ...) + * @param currentType Input Class (or primitive) + * @param literal Value as literal (can be null in some cases) + * @param currentSparqlBinding Value as SPARQL Binding (can be null in some cases) + * @return Object of type currentType + * @throws URISyntaxException thrown, if currentType is URI, but the value cannot be parsed to a URI + * @throws DatatypeConfigurationException thrown, if currentType is XMLGregorianCalendar or Duration, but parsing fails + * @throws IOException thrown, if no matching "simple class" could be found + */ + private Object handlePrimitive(Class currentType, Literal literal, String currentSparqlBinding) throws URISyntaxException, DatatypeConfigurationException, IOException { + //Java way of checking for primitives, i.e. int, char, float, double, ... + if (currentType.isPrimitive()) { + if (literal == null) { + throw new IOException("Trying to handle Java primitive, but got no literal value"); + } + //If it is an actual primitive, there is no need to instantiate anything. Just give it to the function + switch (currentType.getSimpleName()) { + case "int": + return literal.getInt(); + case "boolean": + return literal.getBoolean(); + case "long": + return literal.getLong(); + case "short": + return literal.getShort(); + case "float": + return literal.getFloat(); + case "double": + return literal.getDouble(); + case "byte": + return literal.getByte(); + } + } + + //Check for the more complex literals + + //URI + if (URI.class.isAssignableFrom(currentType)) { + return new URI(currentSparqlBinding); + } + + //String + if (String.class.isAssignableFrom(currentType)) { + return currentSparqlBinding; + } + + //XMLGregorianCalendar + if (XMLGregorianCalendar.class.isAssignableFrom(currentType)) { + //Try parsing this as dateTimeStamp (most specific). If seconds / timezone is missing, DatatypeFormatException will be thrown + try { + return DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(literal.getValue().toString()))); + } + catch (DatatypeFormatException | DateTimeParseException ignored) + { + //Not a valid dateTimeStamp. Try parsing just to Date + try { + Date date = new SimpleDateFormat().parse(literal.getValue().toString()); + GregorianCalendar calendar = new GregorianCalendar(); + calendar.setTime(date); + return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar); + } + catch (ParseException | DateTimeParseException | DatatypeFormatException e2) + { + //Do NOT use literal.getValue(), as that can already cause yet another DatatypeFormatException + throw new IOException("Could not turn " + literal.getString() + " into " + literal.getDatatypeURI(), e2); + } + } + } + + //TypedLiteral + if (LangString.class.isAssignableFrom(currentType)) { + //Either a language tagged string OR literal with type. Only one allowed + if (!literal.getLanguage().equals("")) { + return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); + } + return new DefaultLangString.Builder().text(currentSparqlBinding).language("en-us").build(); // TODO: find a better language tag + } + + //BigInteger + if (BigInteger.class.isAssignableFrom(currentType)) { + return new BigInteger(literal.getString()); + } + + //BigDecimal + if (BigDecimal.class.isAssignableFrom(currentType)) { + return new BigDecimal(literal.getString()); + } + + //byte[] + if (byte[].class.isAssignableFrom(currentType)) { + return currentSparqlBinding.getBytes(); + } + + //Duration + if (Duration.class.isAssignableFrom(currentType)) { + return DatatypeFactory.newInstance().newDuration(currentSparqlBinding); + } + + throw new IOException("Unrecognized primitive type: " + currentType.getName()); + } + + /** + * This list contains all primitive Java types + */ + private final Map> builtInMap = new HashMap<>(); + { + builtInMap.put("int", Integer.TYPE); + builtInMap.put("long", Long.TYPE); + builtInMap.put("double", Double.TYPE); + builtInMap.put("float", Float.TYPE); + builtInMap.put("bool", Boolean.TYPE); + builtInMap.put("char", Character.TYPE); + builtInMap.put("byte", Byte.TYPE); + builtInMap.put("void", Void.TYPE); + builtInMap.put("short", Short.TYPE); + } + + private boolean isArrayListTypePrimitive(Type t) throws IOException { + String typeName = extractTypeNameFromCollection(t); + + try { + //Do not try to call Class.forName(primitive) -- that would throw an exception + if (builtInMap.containsKey(typeName)) return true; + return isPrimitive(Class.forName(typeName)); + } catch (ClassNotFoundException e) { + throw new IOException("Unable to retrieve class from generic", e); + } + } + + private String extractTypeNameFromCollection(Type t) throws IOException { + String typeName = t.getTypeName(); + if (!typeName.startsWith("java.util.ArrayList<") && !typeName.startsWith("java.util.List<") && !typeName.startsWith("java.util.Collection<")) { + throw new IOException("Illegal argument encountered while interpreting type parameter"); + } + //"" or super instead of extends + if(typeName.contains("?")) + { + //last space is where we want to cut off (right after the "extends"), as well as removing the last closing braces + return typeName.substring(typeName.lastIndexOf(" ") + 1, typeName.length() - 1); + } + //No extends + else + { + return typeName.substring(typeName.indexOf("<") + 1, typeName.indexOf(">")); + } + } + + private boolean isPrimitive(Class input) throws IOException { + //Collections are not simple + if (Collection.class.isAssignableFrom(input)) { + throw new IOException("Encountered collection in isPrimitive. Use isArrayListTypePrimitive instead"); + } + + //check for: plain/typed literal, XMLGregorianCalendar, byte[], RdfResource + //covers int, long, short, float, double, boolean, byte + if (input.isPrimitive()) return true; + + return (URI.class.isAssignableFrom(input) || + String.class.isAssignableFrom(input) || + XMLGregorianCalendar.class.isAssignableFrom(input) || + LangString.class.isAssignableFrom(input) || + BigInteger.class.isAssignableFrom(input) || + BigDecimal.class.isAssignableFrom(input) || + byte[].class.isAssignableFrom(input) || + Duration.class.isAssignableFrom(input)); + } + + /** + * Entry point to this class. Takes an RDF Model and a desired target class (can be an interface) + * @param rdfModel RDF input to be parsed + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(Model rdfModel, Class targetClass) throws IOException { + addArtificialBlankNodeLabels(rdfModel); + ArrayList> implementingClasses = getImplementingClasses(targetClass); + + // Query to retrieve all instances in the input graph that have a class assignment + // Assumption: if the class name (?type) is equal to the target class, this should be the + // instance we actually want to parse + String queryString = "SELECT ?id ?type { ?id a ?type . }"; + Query query = QueryFactory.create(queryString); + QueryExecution queryExecution = QueryExecutionFactory.create(query, rdfModel); + ResultSet resultSet = queryExecution.execSelect(); + + if (!resultSet.hasNext()) { + throw new IOException("Could not extract class from input message"); + } + + Map> returnCandidates = new HashMap<>(); + + while (resultSet.hasNext()) { + QuerySolution solution = resultSet.nextSolution(); + String fullName = solution.get("type").toString(); + String className = fullName.substring(fullName.lastIndexOf('/') + 1); + + //In case of hash-namespaces + if(className.contains("#")) { + className = className.substring(className.lastIndexOf("#")); + } + + //For legacy purposes... + if (className.startsWith("ids:") || className.startsWith("aas:")) { + className = className.substring(4); + } + + for (Class currentClass : implementingClasses) { + if (currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { + returnCandidates.put(solution.get("id").toString(), currentClass); + } + } + //if (returnCandidates.size() > 0) break; + } + queryExecution.close(); + + if (returnCandidates.size() == 0) { + throw new IOException("Could not transform input to an appropriate implementing class for " + targetClass.getName()); + } + + //At this point, we parsed the model and know to which implementing class we want to parse + //Check if there are several options available + if(returnCandidates.size() > 1) + { + String bestCandidateId = null; + Class bestCandidateClass = null; + long bestNumRelations = -1L; + for(Map.Entry> entry : returnCandidates.entrySet()) + { + String determineBestCandidateQueryString = "CONSTRUCT { ?s ?p ?o . ?o ?p2 ?o2 . ?o2 ?p3 ?o3 . ?o3 ?p4 ?o4 . ?o4 ?p5 ?o5 . }" + + " WHERE {" + + " BIND(<" + entry.getKey() + "> AS ?s). ?s ?p ?o ." + + " OPTIONAL {?o ?p2 ?o2 . OPTIONAL {?o2 ?p3 ?o3 . OPTIONAL {?o3 ?p4 ?o4 . OPTIONAL {?o4 ?p5 ?o5 . } } } } }"; + Query determineBestCandidateQuery = QueryFactory.create(determineBestCandidateQueryString); + QueryExecution determineBestCandidateQueryExecution = QueryExecutionFactory.create(determineBestCandidateQuery, rdfModel); + long graphSize = determineBestCandidateQueryExecution.execConstruct().size(); + if(graphSize > bestNumRelations) + { + bestNumRelations = graphSize; + bestCandidateId = entry.getKey(); + bestCandidateClass = entry.getValue(); + } + + determineBestCandidateQueryExecution.close(); + + } + logger.debug("The RDF graph contains multiple objects which can be parsed to " + targetClass.getSimpleName() + ". Determined " + bestCandidateId + " as best candidate."); + return (T) handleObject(rdfModel, bestCandidateId, bestCandidateClass); + } + + //We only reach this spot, if there is exactly one return candidate. Let's return it + Map.Entry> singularEntry = returnCandidates.entrySet().iterator().next(); + return (T) handleObject(rdfModel, singularEntry.getKey(), singularEntry.getValue()); + + } + + + /** + * Entry point to this class. Takes a message and a desired target class (can be an interface) + * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(String message, Class targetClass) throws IOException { + Model model = readMessage(message); + return parseMessage(model, targetClass); + } + + /** + * Entry point to this class. Takes a message and a desired target class (can be an interface) + * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function + * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) + * @param serializationFormat Input RDF format + * @param Desired target class + * @return Object of desired target class, representing the values contained in input message + * @throws IOException if the parsing of the message fails + */ + T parseMessage(String message, Class targetClass, Lang serializationFormat) throws IOException { + Model model = readMessage(message, serializationFormat); + return parseMessage(model, targetClass); + } + + /** + * Reads a message into an Apache Jena model, guessing the input language. + * Note: Guessing the language may cause some error messages during parsing attempts + * + * @param message Message to be read + * @return The model of the message + */ + private Model readMessage(String message) throws IOException { + + List supportedLanguages = new ArrayList<>( + Arrays.asList( + RDFLanguages.JSONLD, //JSON-LD first + RDFLanguages.TURTLE, //N-TRIPLE is a subset of Turtle + RDFLanguages.RDFXML + )); + + for (Lang lang : supportedLanguages) { + try { + return readMessage(message, lang); + } catch (IOException ignored) { + } + } + throw new IOException("Could not parse string as any supported RDF format (JSON-LD, Turtle/N-Triple, RDF-XML)."); + } + + /** + * Reads a message into an Apache Jena model, guessing the input language. + * Note: Guessing the language may cause some error messages during parsing attempts + * + * @param message Message to be read + * @param language The RDF serialization of the input. Supported formats are JSON-LD, N-Triple, Turtle, and RDF-XML + * @return The model of the message + */ + private Model readMessage(String message, Lang language) throws IOException { + + Model targetModel = ModelFactory.createDefaultModel(); + + try { + RDFDataMgr.read(targetModel, new ByteArrayInputStream(message.getBytes()), language); + } + catch (RiotException e) + { + throw new IOException("Failed to parse input as " + language, e); + } + return targetModel; + } + + /** + * Get a list of all subclasses (by JsonSubTypes annotation) which can be instantiated + * @param someClass Input class of which implementable subclasses need to be found + * @return ArrayList of instantiable subclasses + */ + ArrayList> getImplementingClasses(Class someClass) { + ArrayList> result = new ArrayList<>(); + KnownSubtypes subTypeAnnotation = someClass.getAnnotation(KnownSubtypes.class); + if (subTypeAnnotation != null) { + KnownSubtypes.Type[] types = subTypeAnnotation.value(); + for (KnownSubtypes.Type type : types) { + result.addAll(getImplementingClasses(type.value())); + } + } + if (!someClass.isInterface() && !Modifier.isAbstract(someClass.getModifiers())) { + result.add(Serializer.customImplementationMap.getOrDefault(someClass, someClass)); + } + return result; + } + + private void addArtificialBlankNodeLabels(Model m) + { + //Get all blank nodes + Query q = QueryFactory.create("SELECT DISTINCT ?s { ?s ?p ?o . FILTER(isBlank(?s)) } "); + QueryExecution qe = QueryExecutionFactory.create(q, m); + ResultSet rs = qe.execSelect(); + List statementsToAdd = new ArrayList<>(); + while(rs.hasNext()) + { + QuerySolution qs = rs.next(); + statementsToAdd.add(ResourceFactory.createStatement(qs.get("?s").asResource(), + ResourceFactory.createProperty(blankNodeIdPropertyUri.toString()), + ResourceFactory.createStringLiteral(qs.get("?s").toString()))); + } + qe.close(); + m.add(statementsToAdd); + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java new file mode 100644 index 000000000..ebdf6c1cc --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.JsonPreprocessor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.TypeNamePreprocessor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.ReflectiveMixInResolver; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.riot.Lang; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.*; + +public class Serializer implements org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer, Deserializer { + + private static final ObjectMapper mapper = new ObjectMapper(); + private final List preprocessors; + private final Logger logger = LoggerFactory.getLogger(Serializer.class); + + public static String implementingClassesNamePrefix = "Default"; + public static String implementingClassesNameSuffix = ""; + + static Map, Class> customImplementationMap = new HashMap<>(); + + private static boolean charsetWarningPrinted = false; + + public Serializer() { + mapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); + mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + mapper.setMixInResolver(new ReflectiveMixInResolver()); + + preprocessors = new ArrayList<>(); + this.addPreprocessor(new TypeNamePreprocessor()); + + if(!Charset.defaultCharset().equals(StandardCharsets.UTF_8) && !charsetWarningPrinted) + { + charsetWarningPrinted = true; + logger.warn("Standard Charset is set to " + Charset.defaultCharset() + " - expecting " + StandardCharsets.UTF_8 + ". Some characters might not be displayed correctly.\nThis warning is only printed once"); + } + + //Default namespaces for AAS + addKnownNamespace("xsd", "http://www.w3.org/2001/XMLSchema#"); + addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); + addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); + //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); + + } + + /** + * Serializes an object to an RDF representation. In order to support RDF, the input instance must be + * annotated using AAS Metamodel annotations. Default format is Turtle (TTL). + * + * @param instance the instance to be serialized + * @return RDF serialization of the provided object graph + * @throws IOException if the serialization fails + */ + public String serialize(Object instance) throws IOException { + return serialize(instance, RDFLanguages.TTL, new HashMap<>()); + } + + /** + * Serializes an object to an RDF representation of a given RDF serialization format. In order to support RDF, the + * input instance must be annotated using AAS Metamodel annotations. + * + * @param instance the instance to be serialized + * @param format the RDF format to be returned (only RDFLanguages.TTL, RDFLanguages.JSONLD, RDFLanguages.RDFXML) + * @return RDF serialization of the provided object graph + * @throws IOException if the serialization fails + */ + public synchronized String serialize(Object instance, Lang format) throws IOException { + return serialize(instance, format, new HashMap<>() ); + } + + + //Synchronized is required for thread safety. Without it, context elements might be missing in case of multiple simultaneous calls to this function + public synchronized String serialize(Object instance, Lang format, Map idMap) throws IOException { + if (format != RDFLanguages.JSONLD && format != RDFLanguages.TURTLE && format != RDFLanguages.RDFXML) { + throw new IOException("RDFFormat " + format + " is currently not supported by the serializer."); + } + mapper.registerModule(new JsonLDModule(idMap)); + String jsonLD = (instance instanceof Collection) + ? serializeCollection((Collection) instance) + : mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); + if (format == RDFLanguages.JSONLD) return jsonLD; + else return convertJsonLdToOtherRdfFormat(jsonLD, format); + } + + private String serializeCollection(Collection collection) throws IOException { + String lineSep = System.lineSeparator(); + StringBuilder jsonLDBuilder = new StringBuilder(); + + if (collection.isEmpty()) { + jsonLDBuilder.append("[]"); + } else { + jsonLDBuilder.append("["); + jsonLDBuilder.append(lineSep); + for (Object item : collection) { + jsonLDBuilder.append(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(item)); + jsonLDBuilder.append(","); + jsonLDBuilder.append(lineSep); + } + int lastComma = jsonLDBuilder.lastIndexOf(","); + jsonLDBuilder.replace(lastComma, lastComma + 1, ""); + jsonLDBuilder.append("]"); + } + jsonLDBuilder.append(lineSep); + + return jsonLDBuilder.toString(); + } + + public String convertJsonLdToOtherRdfFormat(String jsonLd, Lang format) { + Model model = ModelFactory.createDefaultModel(); + RDFDataMgr.read(model, new ByteArrayInputStream(jsonLd.getBytes()), RDFLanguages.JSONLD); + + ByteArrayOutputStream os = new ByteArrayOutputStream(); + RDFDataMgr.write(os, model, format); + return os.toString(); + } + + public String serializePlainJson(Object instance) throws JsonProcessingException { + return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); + } + + /** + * Inverse method of "serialize" + * + * @param serialization JSON(-LD) string + * @param valueType class of top level type + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(String serialization, Class valueType) throws DeserializationException { + try { + return new Parser().parseMessage(serialization, valueType); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Inverse method of "serialize" + * + * @param serialization JSON(-LD) string + * @param valueType class of top level type + * @param serializationFormat RDF input format + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(String serialization, Class valueType, Lang serializationFormat) throws DeserializationException { + try { + + return new Parser().parseMessage(serialization, valueType, serializationFormat); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Inverse method of "serialize" + * + * @param rdfModel Input RDF Model to be turned into an Instance of the IDS Java classes + * @param valueType class of top level type + * @param deserialized type + * @return an object representing the provided JSON(-LD) structure + * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF + */ + public T deserialize(Model rdfModel, Class valueType) throws DeserializationException { + try { + return new Parser().parseMessage(rdfModel, valueType); + } + catch (IOException e) + { + throw new DeserializationException("Failed to deserialize input.", e); + } + } + + /** + * Allows to add further known namespaces to the message parser. Allows parsing to Java objects with JsonSubTypes annotations with other prefixes than "ids:". + * @param prefix Prefix to be added + * @param namespaceUrl URL of the prefix + */ + public static void addKnownNamespace(String prefix, String namespaceUrl) + { + Parser.knownNamespaces.put(prefix, namespaceUrl); + JsonLDSerializer.contextItems.put(prefix, namespaceUrl); + } + + /** + * Method to add a preprocessor for deserialization. + *

+ * Important note: The preprocessors are executed in the same order they were added. + * + * @param preprocessor the preprocessor to add + */ + public void addPreprocessor(JsonPreprocessor preprocessor) { + preprocessors.add(preprocessor); + } + + /** + * Method to add a preprocessor for deserialization. + *

+ * Important note: The preprocessors are executed in the same order they were added. + * + * @param preprocessor the preprocessor to add + * @param validate set whether the preprocessors output should be checked by RDF4j + */ + public void addPreprocessor(JsonPreprocessor preprocessor, boolean validate) { + preprocessor.enableRDFValidation(validate); + addPreprocessor(preprocessor); + } + + /** + * remove a preprocessor if no longer needed + * + * @param preprocessor the preprocessor to remove + */ + public void removePreprocessor(JsonPreprocessor preprocessor) { + preprocessors.remove(preprocessor); + } + + @Override + public String write(Environment aasEnvironment) throws SerializationException { + try { + return serialize(aasEnvironment); + } + catch (IOException e) + { + throw new SerializationException("Failed to serialize environment.", e); + } + } + + public String write(Environment aasEnvironment, Lang format) throws SerializationException { + return write(aasEnvironment, format, new HashMap<>()); + } + + public String write(Environment aasEnvironment, Lang format, Map idMap) throws SerializationException { + try { + return serialize(aasEnvironment, format, idMap); + } + catch (IOException e) + { + throw new SerializationException("Failed to serialize environment.", e); + } + } + @Override + public Environment read(String value) throws DeserializationException { + try { + return new Parser().parseMessage(value, Environment.class); + } + catch (IOException e) + { + throw new DeserializationException("Could not deserialize to environment.", e); + } + } + + public Environment read(String value, Lang serializationFormat) throws DeserializationException { + try { + return new Parser().parseMessage(value, Environment.class, serializationFormat); + } + catch (IOException e) + { + throw new DeserializationException("Could not deserialize to environment.", e); + } + } + + @Override + public void useImplementation(Class aasInterface, Class implementation) { + customImplementationMap.put(aasInterface, implementation); + //throw new NotImplementedException("Custom implementation support not yet implemented"); + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java new file mode 100644 index 000000000..972b02561 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import java.io.IOException; +import java.net.URI; + + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonStreamContext; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +public class UriSerializer extends StdSerializer { + + + public UriSerializer() { + this(null); + } + + public UriSerializer(Class clazz) { + super(clazz); + } + + + @Override + public void serialize(URI value, JsonGenerator gen, SerializerProvider provider) throws IOException { + String serializedUri = value.toString(); + // String idPattern = "{\"@id\": \"" + serializedUri + "\"}"; + JsonStreamContext context = gen.getOutputContext(); + if (context.getCurrentName() != null && context.getCurrentName().contains("@id")) { + gen.writeString(serializedUri); + } else { + gen.writeStartObject(); + gen.writeStringField("@id", serializedUri); + gen.writeEndObject(); + } + } + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java new file mode 100644 index 000000000..d2e04c6db --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import java.io.IOException; +import java.math.BigDecimal; + +public class BigDecimalSerializer extends StdSerializer { + + public BigDecimalSerializer() { + this(null); + } + + public BigDecimalSerializer(Class clazz) { + super(clazz); + } + + @Override + public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider provider) throws IOException { + gen.writeStartObject(); + gen.writeStringField("@value", value.toString()); + gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#decimal"); + gen.writeEndObject(); + } +} \ No newline at end of file diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java new file mode 100644 index 000000000..47ff2ec1d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.JsonLdEnumSerializer; + +@JsonSerialize(using = JsonLdEnumSerializer.class) +public class JsonLdEnumMixin { +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java new file mode 100644 index 000000000..c60d62dc9 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + + +import java.util.List; + +@JsonTypeName("rdf:langString") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface LangStringMixin { + @JsonProperty("@value") + public String getValue(); + + @JsonProperty("@language") + public String getLanguage(); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java new file mode 100644 index 000000000..e7eb1a61c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.databind.introspect.ClassIntrospector; + +public class ReflectiveMixInResolver implements ClassIntrospector.MixInResolver { + + @Override + public Class findMixInClassFor(Class cls) { + if (cls.isEnum()) + { + return JsonLdEnumMixin.class; + } + try { + return Class.forName("org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins." + cls.getSimpleName() + "Mixin"); + } + catch (ClassNotFoundException ignored) + { + return null; + } + } + + @Override + public ClassIntrospector.MixInResolver copy() { + return new ReflectiveMixInResolver(); + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java new file mode 100644 index 000000000..94c0f9d08 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.IOException; +import java.time.ZonedDateTime; +import java.util.GregorianCalendar; + +public class XMLGregorianCalendarDeserializer extends StdDeserializer { + + public XMLGregorianCalendarDeserializer() { + this(XMLGregorianCalendar.class); + } + + public XMLGregorianCalendarDeserializer(Class clazz) { + super(clazz); + } + + @Override + public XMLGregorianCalendar deserialize(JsonParser p, DeserializationContext context) throws IOException { + XMLGregorianCalendar xgc = null; + try { + xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(p.getValueAsString()))); + } catch (DatatypeConfigurationException e) { + e.printStackTrace(); + } + return xgc; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java new file mode 100644 index 000000000..a4cfb571c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +import javax.xml.datatype.XMLGregorianCalendar; +import java.io.IOException; +import java.text.SimpleDateFormat; + +public class XMLGregorianCalendarSerializer extends StdSerializer { + + public XMLGregorianCalendarSerializer() { + this(null); + } + + public XMLGregorianCalendarSerializer(Class clazz) { + super(clazz); + } + + @Override + public void serialize(XMLGregorianCalendar value, JsonGenerator gen, SerializerProvider provider) throws IOException { + SimpleDateFormat xsdDateTimeStampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); + xsdDateTimeStampFormat.setCalendar(value.toGregorianCalendar()); + String xsdDateTimeStampFormatted = xsdDateTimeStampFormat.format(value.toGregorianCalendar().getTime()); + gen.writeStartObject(); + gen.writeStringField("@value", xsdDateTimeStampFormatted); + gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#dateTimeStamp"); + gen.writeEndObject(); + + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java new file mode 100644 index 000000000..f3b92a6e0 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:AdministrativeInformation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AdministrativeInformationMixin extends HasDataSpecificationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + String getVersion(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + void setVersion(String version); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + String getRevision(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + void setRevision(String revision); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java new file mode 100644 index 000000000..44edbc177 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; + +import java.util.List; + +@JsonTypeName("aas:AnnotatedRelationshipElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AnnotatedRelationshipElementMixin extends RelationshipElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") + List getAnnotations(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") + void setAnnotations(List annotations); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java new file mode 100644 index 000000000..306463292 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:AssetAdministrationShell") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AssetAdministrationShellMixin extends HasDataSpecificationMixin, IdentifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + void setAssetInformation(AssetInformation assetInformation); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + void setDerivedFrom(Reference derivedFrom); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") + List getSubmodels(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") + void setSubmodels(List submodels); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java new file mode 100644 index 000000000..45f2afe13 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:AssetInformation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface AssetInformationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + AssetKind getAssetKind(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + void setAssetKind(AssetKind assetKind); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + Reference getGlobalAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + void setGlobalAssetId(Reference globalAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + List getSpecificAssetIds(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + void setSpecificAssetIds(List specificAssetIds); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") + List getBillOfMaterials(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") + void setBillOfMaterials(List billOfMaterials); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + File getDefaultThumbnail(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + void setDefaultThumbnail(File defaultThumbnail); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java new file mode 100644 index 000000000..2690318f6 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +@JsonTypeName("aas:BasicEventElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface BasicEventElementMixin extends EventElementMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + Direction getDirection(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + void setDirection(Direction direction); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + String getLastUpdate(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + void setLastUpdate(String lastUpdate); + + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + String getMaxInterval(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + void setMaxInterval(String maxInterval); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + Reference getMessageBroker(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + void setMessageBroker(Reference messageBroker); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + String getMessageTopic(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + void setMessageTopic(String messageTopic); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + String getMinInterval(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + void setMinInterval(String minInterval); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + Reference getObserved(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + void setObserved(Reference observed); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + StateOfEvent getState(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + void setState(StateOfEvent state); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java new file mode 100644 index 000000000..dfb2e7a6d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Blob") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface BlobMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + void setConentType(String mimeType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") + byte[] getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") + void setValue(byte[] value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java new file mode 100644 index 000000000..1991a410d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Capability") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface CapabilityMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java new file mode 100644 index 000000000..196244ecd --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:ConceptDescription") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ConceptDescriptionMixin extends HasDataSpecificationMixin, IdentifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + List getIsCaseOf(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + void setIsCaseOf(List isCaseOf); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java new file mode 100644 index 000000000..abc0d5f1d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +@JsonTypeName("aas:DataElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = File.class), + @JsonSubTypes.Type(value = Blob.class), + @JsonSubTypes.Type(value = MultiLanguageProperty.class), + @JsonSubTypes.Type(value = Property.class), + @JsonSubTypes.Type(value = Range.class), + @JsonSubTypes.Type(value = ReferenceElement.class) +}) +public interface DataElementMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java new file mode 100644 index 000000000..ecef45ebc --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +@JsonTypeName("aas:DataSpecificationContent") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) +}) +public interface DataSpecificationContentMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java new file mode 100644 index 000000000..13c3b6aec --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +@JsonTypeName("aas:DataSpecificationIEC61360") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + public DataTypeIEC61360 getDataType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + public void setDataType(DataTypeIEC61360 dataType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + public List getDefinition(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + public void setDefinitions(List definition); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + public LevelType getLevelType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + public void setLevelType(LevelType levelType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + public List getPreferredName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + public void setPreferredName(List preferredName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + public List getShortName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + public void setShortName(List shortName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + public String getSourceOfDefinition(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + public void setSourceOfDefinition(String sourceOfDefinition); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + public String getSymbol(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + public void setSymbol(String symbol); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + public String getUnit(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + public void setUnit(String unit); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + public Reference getUnitId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + public void setUnitId(Reference unitId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + public String getValueFormat(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + public void setValueFormat(String valueFormat); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + public String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + public void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + public ValueList getValueList(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + public void setValueList(ValueList valueList); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + public Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + public void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java new file mode 100644 index 000000000..8caf8a712 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + +@JsonTypeName("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface DataSpecificationPhysicalUnitMixin { + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + String getConversionFactor(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + void setConversionFactor(String conversionFactor); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") + List getDefinitions(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") + void setDefinitions(List definitions); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + String getDinNotation(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + void setDinNotation(String dinNotation); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + String getEceCode(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + void setEceCode(String eceCode); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + String getEceName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + void setEceName(String eceName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + String getNistName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + void setNistName(String nistName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") + String getSiName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") + void setSiName(String siName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + String getSiNotation(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + void setSiNotation(String siNotation); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + String getRegistrationAuthorityId(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + void setRegistrationAuthorityId(String registrationAuthorityId); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + String getSupplier(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + void setSupplier(String supplier); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + String getUnitName(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + void setUnitName(String unitName); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + String getUnitSymbol(); + + @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + void setUnitSymbol(String unitSymbol); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java new file mode 100644 index 000000000..af4615037 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:EmbeddedDataSpecification") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EmbeddedDataSpecificationMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + public DataSpecificationIEC61360 getDataSpecificationContent(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + public Reference getDataSpecification(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + public void setDataSpecification(Reference dataSpecification); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java new file mode 100644 index 000000000..c99abc22d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Entity") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EntityMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + Reference getGlobalAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + void setGlobalAssetId(Reference globalAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + SpecificAssetId getSpecificAssetId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + void setSpecificAssetId(SpecificAssetId specificAssetId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + EntityType getEntityType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + void setEntityType(EntityType entityType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") + List getStatements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") + void setStatements(List statements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java new file mode 100644 index 000000000..d11186246 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +import java.util.List; + +@JsonTypeName("aas:Environment") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EnvironmentMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + List getAssetAdministrationShells(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + void setAssetAdministrationShells(List assetAdministrationShells); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + List getConceptDescriptions(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + void setConceptDescriptions(List conceptDescriptions); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + List getSubmodels(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + void setSubmodels(List submodels); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java new file mode 100644 index 000000000..242a382b8 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; + + +@JsonTypeName("aas:EventElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = BasicEventElement.class) +}) +public interface EventElementMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java new file mode 100644 index 000000000..cf749d68b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:EventMessage") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface EventMessageMixin extends SubmodelElementMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java new file mode 100644 index 000000000..49d8ef044 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Extension") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ExtensionMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") + String getName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") + void setName(String name); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + Reference getRefersTo(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + void setRefersTo(Reference refersTo); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java new file mode 100644 index 000000000..b3d153445 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:File") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface FileMixin extends DataElementMixin, SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") + void setContentType(String contentType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") + void setValue(String value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java new file mode 100644 index 000000000..a8005ea52 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:Formula") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface FormulaMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") + List getDependsOns(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") + void setDependsOns(List dependsOns); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java new file mode 100644 index 000000000..9663339aa --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +import java.util.List; + +@JsonTypeName("aas:HasDataSpecification") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = AdministrativeInformation.class), + @JsonSubTypes.Type(value = AssetAdministrationShell.class), + @JsonSubTypes.Type(value = ConceptDescription.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface HasDataSpecificationMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") + List getDataSpecifications(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") + void setDataSpecifications(List dataSpecifications); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + List getEmbeddedDataSpecifications(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + void setEmbeddedDataSpecifications(List embeddedDataSpecifications); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java new file mode 100644 index 000000000..734ee4bbf --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; + +import java.util.List; + +@JsonTypeName("aas:HasExtensions") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface HasExtensionsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") + List getExtensions(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") + void setExtensions(List extensions); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java new file mode 100644 index 000000000..23a5c6a05 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +@JsonTypeName("aas:HasKind") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface HasKindMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + ModelingKind getKind(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + void setKind(ModelingKind kind); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java new file mode 100644 index 000000000..588ad4c8e --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + + +@JsonTypeName("aas:HasSemantics") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SpecificAssetId.class), + @JsonSubTypes.Type(value = SubmodelElement.class), + @JsonSubTypes.Type(value = Qualifier.class), + @JsonSubTypes.Type(value = Extension.class) +}) +public interface HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + Reference getSemanticId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + void setSemanticId(Reference semanticId); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + List getSupplementalSemanticIds(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + void setSupplementalSemanticIds(List references); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java new file mode 100644 index 000000000..4e165f986 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +@JsonTypeName("aas:Identifiable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = AssetAdministrationShell.class), + @JsonSubTypes.Type(value = ConceptDescription.class) +}) +public interface IdentifiableMixin extends ReferableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + AdministrativeInformation getAdministration(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + void setAdministration(AdministrativeInformation administration); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + String getId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + void setId(String id); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java new file mode 100644 index 000000000..7c7f55f2a --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:IdentifierKeyValuePair") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface IdentifierKeyValuePairMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") + String getKey(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") + void setKey(String key); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") + Reference getExternalSubjectId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") + void setExternalSubjectId(Reference externalSubjectId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java new file mode 100644 index 000000000..1416e89a7 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Identifier") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface IdentifierMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") + String getIdentifier(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") + void setIdentifier(String identifier); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java new file mode 100644 index 000000000..1d1c5c763 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + +@JsonTypeName("aas:Key") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface KeyMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") + KeyTypes getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") + void setType(KeyTypes type); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") + void setValue(String value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java new file mode 100644 index 000000000..562facc00 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:MultiLanguageProperty") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface MultiLanguagePropertyMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + List getValues(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + void setValues(List values); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java new file mode 100644 index 000000000..95e005f22 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:ObjectAttributes") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ObjectAttributesMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") + List getObjectAttributes(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") + void setObjectAttributes(List objectAttributes); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java new file mode 100644 index 000000000..3ad6ca03d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import java.util.List; + +@JsonTypeName("aas:Operation") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface OperationMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") + List getInputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") + void setInputVariables(List inputVariables); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") + List getInoutputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") + void setInoutputVariables(List inoutputVariables); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") + List getOutputVariables(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") + void setOutputVariables(List outputVariables); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java new file mode 100644 index 000000000..76e45277b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +@JsonTypeName("aas:OperationVariable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface OperationVariableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + SubmodelElement getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + void setValue(SubmodelElement value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java new file mode 100644 index 000000000..fade7f4e7 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:PolicyDecisionPoint") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyDecisionPointMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") + boolean getExternalPolicyDecisionPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") + void setExternalPolicyDecisionPoints(boolean externalPolicyDecisionPoints); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java new file mode 100644 index 000000000..331c8a872 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:PolicyEnforcementPoints") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyEnforcementPointsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") + boolean getExternalPolicyEnforcementPoint(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") + void setExternalPolicyEnforcementPoint(boolean externalPolicyEnforcementPoint); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java new file mode 100644 index 000000000..817bb2f5c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:PolicyInformationPoints") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PolicyInformationPointsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") + boolean getExternalInformationPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") + void setExternalInformationPoints(boolean externalInformationPoints); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") + List getInternalInformationPoints(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") + void setInternalInformationPoints(List internalInformationPoints); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java new file mode 100644 index 000000000..7658c2e2c --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Property") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface PropertyMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java new file mode 100644 index 000000000..739dfc67f --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + +import java.util.List; + +@JsonTypeName("aas:Qualifiable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Submodel.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface QualifiableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") + List getQualifiers(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") + void setQualifiers(List qualifiers); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java new file mode 100644 index 000000000..899cbe893 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:Qualifier") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface QualifierMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + String getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + void setType(String type); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java new file mode 100644 index 000000000..fb38aafc5 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeName("aas:Range") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface RangeMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + String getValueType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + void setValueType(String valueType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") + String getMax(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") + void setMax(String max); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") + String getMin(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") + void setMin(String min); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java new file mode 100644 index 000000000..c31908a5d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Referable") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Identifiable.class), + @JsonSubTypes.Type(value = SubmodelElement.class) +}) +public interface ReferableMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") + String getCategory(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") + void setCategory(String category); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") + List getDescription(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") + void setDescription(List description); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + List getDisplayName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + void setDisplayName(List displayName); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + String getIdShort(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + void setIdShort(String idShort); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java new file mode 100644 index 000000000..0a4cb3668 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:ReferenceElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ReferenceElementMixin extends DataElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + Reference getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + void setValue(Reference value); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java new file mode 100644 index 000000000..bd836cf9d --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.util.List; + +@JsonTypeName("aas:Reference") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ReferenceMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + List getKeys(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + void setKeys(List keys); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") + ReferenceTypes getType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") + void setType(ReferenceTypes type); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java new file mode 100644 index 000000000..d523598ab --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:RelationshipElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = AnnotatedRelationshipElement.class) +}) +public interface RelationshipElementMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + Reference getFirst(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + void setFirst(Reference first); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + Reference getSecond(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + void setSecond(Reference second); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java new file mode 100644 index 000000000..6f535d8a2 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; + +import java.util.List; + +@JsonTypeName("aas:Resource") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ResourceMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + String getContentType(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + void setContentType(String contentType); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") + String getPath(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") + void setPath(String path); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java new file mode 100644 index 000000000..940f36639 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +@JsonTypeName("aas:SpecificAssetId") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SpecificAssetIdMixin extends HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + String getName(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + void setName(String name); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + void setExternalSubjectId(Reference reference); + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java new file mode 100644 index 000000000..6ee1af3b6 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; + +import java.util.List; + +@JsonTypeName("aas:SubjectAttributes") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubjectAttributesMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") + List getSubjectAttributes(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") + void setSubjectAttributes(List subjectAttributes); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java new file mode 100644 index 000000000..f9559be87 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.Collection; + +@JsonTypeName("aas:SubmodelElementCollection") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelElementCollectionMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") + boolean getAllowDuplicates(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") + void setAllowDuplicates(boolean allowDuplicates); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") + boolean getOrdered(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") + void setOrdered(boolean ordered); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + Collection getValues(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + void setValues(Collection values); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java new file mode 100644 index 000000000..2b754f2c1 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.util.List; + +@JsonTypeName("aas:SubmodelElementList") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelElementListMixin extends SubmodelElementMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + boolean getOrderRelevant(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + void setOrderRelevant(boolean orderRelevant); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + Reference getSemanticIdListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + void setSemanticIdListElement(Reference semanticIdListElement); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + AasSubmodelElements getTypeValueListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + void setTypeValueListElement(AasSubmodelElements typeValueListElement); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + List getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + void setValue(List value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java new file mode 100644 index 000000000..f8f878da4 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + +@JsonTypeName("aas:SubmodelElement") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = RelationshipElement.class), + @JsonSubTypes.Type(value = DataElement.class), + @JsonSubTypes.Type(value = File.class), + @JsonSubTypes.Type(value = Capability.class), + @JsonSubTypes.Type(value = Entity.class), + @JsonSubTypes.Type(value = EventElement.class), + @JsonSubTypes.Type(value = EventPayload.class), + @JsonSubTypes.Type(value = Operation.class), + @JsonSubTypes.Type(value = SubmodelElementCollection.class) +}) +public interface SubmodelElementMixin extends ReferableMixin, QualifiableMixin, HasDataSpecificationMixin, HasKindMixin, HasSemanticsMixin { + +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java new file mode 100644 index 000000000..a5dcc9a8b --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.List; + +@JsonTypeName("aas:Submodel") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface SubmodelMixin extends QualifiableMixin, HasDataSpecificationMixin, IdentifiableMixin, HasKindMixin, HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") + List getSubmodelElements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") + void setSubmodelElements(List submodelElements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java new file mode 100644 index 000000000..5d7ac5811 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; + +import java.util.List; + + +@JsonTypeName("aas:ValueList") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ValueListMixin { + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + List getValueReferencePairs(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + void setValueReferencePairs(List valueReferencePairs); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java new file mode 100644 index 000000000..fc75ff057 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonTypeName("aas:ValueReferencePair") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ValueReferencePairMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + String getValue(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + void setValue(String value); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + Reference getValueId(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java new file mode 100644 index 000000000..dcae112eb --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import java.util.List; + +@JsonTypeName("aas:View") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") +public interface ViewMixin extends ReferableMixin, HasDataSpecificationMixin, HasSemanticsMixin { + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") + List getContainedElements(); + + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") + void setContainedElements(List containedElements); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java new file mode 100644 index 000000000..209b9e98f --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + + +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.riot.RDFDataMgr; +import org.apache.jena.riot.RDFLanguages; + + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +/** + * basic implementation of {@code JsonPreprocessor} that encapsulates validation. + * By default, validation is disabled for performance reasons (@context has to be downloaded each time). + */ +public abstract class BasePreprocessor implements JsonPreprocessor { + + private boolean validate = false; + + + @Override + public final String preprocess(String input) throws IOException { + String result = preprocess_impl(input); + if(validate) { + Model m = ModelFactory.createDefaultModel(); + RDFDataMgr.read(m, new ByteArrayInputStream(result.getBytes()), RDFLanguages.JSONLD); + } + return result; + } + + abstract String preprocess_impl(String input) throws IOException; + + @Override + public void enableRDFValidation(boolean validate) { + this.validate = validate; + } +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java new file mode 100644 index 000000000..eb99ac8b3 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + +import java.io.IOException; + +/** + * Interface for JSON-LD preprocessors which should transform JSON-LD inputs + * before they are deserialized by Jackson. + * + * Implementations used at the same time must not interfere with each other. + */ +public interface JsonPreprocessor { + + /** + * preprocessing method + * @param input of the transformation, the original JSON-LD + * @return the transformation´s result + * @throws IOException if preprocessing fails, e.g. because the input is not valid RDF + */ + public String preprocess(String input) throws IOException; + + /** + * specify wheter the transformation's result should be validated to + * be parsable by RDF4j + * @param validate enable/disable switch + */ + public void enableRDFValidation(boolean validate); +} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java new file mode 100644 index 000000000..e117d0359 --- /dev/null +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +public class TypeNamePreprocessor extends BasePreprocessor { + + private static final Map prefixes; + + static { + prefixes = new HashMap<>(); + prefixes.put("ids:", "https://w3id.org/idsa/core/"); + prefixes.put("idsc:", "https://w3id.org/idsa/code/"); + prefixes.put("info:", "http://www.fraunhofer.de/fraunhofer-digital/infomodell#"); + prefixes.put("kdsf:", "http://kerndatensatz-forschung.de/version1/technisches_datenmodell/owl/Basis#"); + } + + @Override + String preprocess_impl(String input) throws IOException { + ObjectMapper mapper = new ObjectMapper(); + Map inMap = mapper.readValue(input, Map.class); + Map outMap = unifyTypeURIPrefix(inMap); + return mapper.writeValueAsString(outMap); + } + + + private Map unifyTypeURIPrefix(Map in) { + Map out = new LinkedHashMap<>(); + in.forEach((k,v) -> { + if(v instanceof String && k instanceof String && k.equals("@type")) { + + + // if key is @type and value is a string: add 'ids:' if no other namespace at the value + AtomicReference modifiableValue = new AtomicReference<>((String) v); + prefixes.forEach((p, u) -> modifiableValue.set(modifiableValue.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableValue.get().startsWith("ids:") + || modifiableValue.get().startsWith("idsc:") + || modifiableValue.get().startsWith("info:") + || modifiableValue.get().startsWith("kdsf:") + || modifiableValue.get().startsWith("xsd:") + || modifiableValue.get().startsWith("http://") + || modifiableValue.get().startsWith("https://"))) { + modifiableValue.set("ids:".concat(modifiableValue.get())); // default to ids prefix for backwards compatibility + } + out.put(k, modifiableValue.get()); + + + } else if(v instanceof Map) { + AtomicReference modifiableKey = new AtomicReference<>((String) k); + + prefixes.forEach((prefix, uri) -> modifiableKey.set(modifiableKey.get().replace(uri, prefix))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://") + || modifiableKey.get().startsWith("@context"))) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + + + // shorten an @id Map + if (((Map) v).containsKey("@id") && ((Map) v).keySet().size() == 1) { + Map idMap = new LinkedHashMap<>(); + idMap.put(k, ((Map) v).get("@id")); + + out.putAll(unifyTypeURIPrefix(idMap)); + + } else if (((Map) v).containsKey("@value") && + ((Map) v).containsKey("@type")) + { + if( ((Map) v).get("@type").toString().contains("dateTime") ) + { + + // shorten an @value Map with xsd:dateTimes + Object date = ((Map) v).get("@value"); + out.put(modifiableKey, date); + } + else if(((Map) v).get("@type").toString().equals("xsd:integer")) + { + int value = Integer.parseInt(((Map) v).get("@value").toString()); + out.put(modifiableKey, value); + } + else { //Do the same as below + out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); + } + + } else { + + out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); + + + } + + } else if(v instanceof ArrayList) { + + + AtomicReference modifiableKey = new AtomicReference<>((String) k); + prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://"))) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + + Iterator iter = new ArrayList((ArrayList) v).iterator(); //making a copy of the old array so the iterator does not get confused by the element deletions + while (iter.hasNext()) { + Object child = iter.next(); + if (child instanceof Map && ((Map) child).containsKey("@id") && ((Map) child).keySet().size() == 1) { + ((ArrayList) v).remove(child); + ((ArrayList) v).add(((Map) child).get("@id")); + } + } + + out.put(modifiableKey, unifyTypeURIPrefix((ArrayList) v)); // TODO: What happens with an Array inside the Array? + + + } else { + + + AtomicReference modifiableKey = new AtomicReference<>((String) k); + prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix + if(! (modifiableKey.get().startsWith("ids:") + || modifiableKey.get().startsWith("info:") + || modifiableKey.get().startsWith("kdsf:") + || modifiableKey.get().startsWith("http://") + || modifiableKey.get().startsWith("https://") + || modifiableKey.get().startsWith("@"))) { + //in the context definition, a pair might look like this: "ids" : "http://www.someURL.com" + //Here, we start with "ids", not "ids:". So we also need to check that the key is not contained in our prefixes + if(!prefixes.containsKey(modifiableKey.get() + ":")) { + modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility + } + } + + out.put(modifiableKey, v); // modify nothing if not @type or a map + } + }); + return out; + } + + + private ArrayList unifyTypeURIPrefix(ArrayList in) { + ArrayList out = new ArrayList<>(); + + Iterator iter = in.iterator(); + + while (iter.hasNext()) { + Object v = iter.next(); + if(v instanceof Map) { + + + if (!((Map) v).isEmpty()) + out.add( unifyTypeURIPrefix((Map) v)); + + + } else if (v instanceof String) { + + out.add(v); // modify nothing if not @type or a map + } else { + out.add(v); + } + } + return out; + } + + + + +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java new file mode 100644 index 000000000..8d603f749 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; + +import org.apache.jena.riot.RDFLanguages; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; + +import junitparams.JUnitParamsRunner; +import junitparams.Parameters; + +import java.io.IOException; + +@RunWith(JUnitParamsRunner.class) +public class ParserTest { + + @Test + public void parseAasEnvironmentTest() throws IOException, DeserializationException { + String aasEnvAsString = SerializerUtil.readResourceToString("example-from-serializer.jsonld"); + Environment aasEnv = new Serializer().read(aasEnvAsString); + Assert.assertEquals(1, aasEnv.getSubmodels().size()); + Assert.assertEquals(1, aasEnv.getAssetAdministrationShells().get(0).getDescription().size()); + Assert.assertEquals(2, aasEnv.getAssetAdministrationShells().get(0).getDisplayName().size()); + + Assert.assertEquals("de", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(0).getLanguage()); + Assert.assertEquals("en", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(1).getLanguage()); + Assert.assertNotNull(aasEnv.getAssetAdministrationShells().get(0).getDescription().get(0).getLanguage()); + + } + + @Test + @Ignore + public void parseFullTurtleEnvironmentTest() throws IOException, DeserializationException { + String aasEnvAsString = SerializerUtil.readResourceToString("AASFull.ttl"); + Environment environment = new Serializer().read(aasEnvAsString); + + // TODO continue providing a correct AASFull Turtle representation + // TODO test for LangStrings + Assert.assertEquals(AASFull.ENVIRONMENT, environment); + } + + + @Test + @Parameters({"AAS_Reference_shortExample.ttl", "AssetAdministrationShell_Example.ttl", + "Complete_Example.ttl", "ReferenceExample.ttl" /*, "KapitalVerwaltungsschaleExample.ttl"*/}) + public void parseAasTurtleSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + + AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file),AssetAdministrationShell.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); + } + + @Test + @Parameters({ "AAS_Reference_shortExample.nt", "Overall-Example.nt"}) + public void parseAasNtriplesSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + + AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file), AssetAdministrationShell.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); + } + + @Test + @Parameters({"Submodel_SubmodelElement_Example.ttl"}) + public void parseSubmodelSchemaExamplesTest(String file) throws IOException, DeserializationException { + Serializer serializer = new Serializer(); + //These work + + Submodel submodel = serializer.deserialize(SerializerUtil.readResourceToString(file), Submodel.class, RDFLanguages.TURTLE); + + Assert.assertNotNull(submodel.getSubmodelElements().get(0).getIdShort()); + + + //The following examples do not work yet, as they are semantically problematic + //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.ttl"), Reference.class, RDFLanguages.TURTLE); + //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.nt"), Reference.class, RDFLanguages.NTRIPLES); + } + + + + + @Test + public void deserializeConceptDescription() throws IOException, DeserializationException { + String conceptDescription = "{\n" + + " \"@context\" : {\n" + + " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + + " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + + " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + + " },\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + + " \"@type\" : \"aas:ConceptDescription\",\n" + + " \"isCaseOf\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications\" : [ {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecification/f461858c-8981-4141-bac3-6aee56977017\",\n" + + " \"@type\" : \"aas:EmbeddedDataSpecification\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation\" : {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultReference/41ee5bcc-adde-4a5a-bfb5-ace237247d0c\",\n" + + " \"@type\" : \"aas:Reference\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/Reference/key\" : [ {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultKey/234b457f-0e8f-46b3-8e73-f850a79269f1\",\n" + + " \"@type\" : \"aas:Key\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/Key/value\" : \"https://example.org\"\n" + + " } ]\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + + " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + + " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + + " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + + " },\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + + " } ]\n" + + "}"; + + Serializer serializer = new Serializer(); + ConceptDescription c = serializer.deserialize(conceptDescription, ConceptDescription.class); + + Assert.assertNotNull(c); + } + + +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java new file mode 100644 index 000000000..2d7d56c03 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.apache.jena.riot.RDFLanguages; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class SerializerTest { + + //TODO: Optional: Prefixes instead of full URIs + //TODO: Optional: Do not serialize empty collections + + @Test + public void serializeEnvironment() throws IOException, DeserializationException { + + AssetAdministrationShell aas = new DefaultAssetAdministrationShell.Builder() + .assetInformation(new DefaultAssetInformation.Builder() + .assetKind(AssetKind.INSTANCE) + .build()) + .description(Arrays.asList(new DefaultLangString.Builder().text("This is a test AAS").language("en-us").build())) + .displayName(Arrays.asList( + new DefaultLangString.Builder().text("Anzeigename 2").language("de").build(), + new DefaultLangString.Builder().text("Display Name 1").language("en").build() + )) + .build(); + + Submodel submodel = new DefaultSubmodel.Builder() + .description(Arrays.asList(new DefaultLangString.Builder().text("My Submodel").language("en-us").build())) + .displayName(Arrays.asList( + new DefaultLangString.Builder().text("First Submodel Element name").language("en").build(), + new DefaultLangString.Builder().text("Second Submodel Element name").language("en").build() + )) + .category("Example category") + .build(); + + ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .value("https://example.org") + .build()) + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataType(DataTypeIEC61360.RATIONAL) + .build()) + .build()) + .build(); + + List aasList = new ArrayList<>(Collections.singletonList(aas)); + Environment aasEnv = new DefaultEnvironment.Builder() + .assetAdministrationShells(aasList) + .submodels(submodel) + .conceptDescriptions(conceptDescription) + .build(); + + String output = new Serializer().serialize(aasEnv, RDFLanguages.JSONLD); + //System.out.println(output); + + Assert.assertTrue(output.contains("@context")); + // Assert.assertTrue(output.contains("rdf:")); // TODO: why should the output contain the 'rdf' prefix? + Assert.assertTrue(output.contains("\"@type\" : \"aas:Environment\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:AssetAdministrationShell\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:Submodel\"")); + Assert.assertTrue(output.contains("\"@type\" : \"aas:ConceptDescription\"")); + + Environment environment = new Serializer().deserialize(output, Environment.class); + Assert.assertNotNull(environment); + + // Assert.assertTrue(aasEnv.equals(environment)); // TODO: Serialising and parsing to/from RDF looses the sequence of e.g. LangStrings, therefore this test fails also for semantically equal objects + } +} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java new file mode 100644 index 000000000..b738b7278 --- /dev/null +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; + + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; + +import org.apache.commons.io.IOUtils; + +/** + * Helper class for Serializer Tests + * + * @author sbader + * + */ +public class SerializerUtil { + + public static String readResourceToString(String resourceName) throws IOException { + ClassLoader classloader = Thread.currentThread().getContextClassLoader(); + InputStream is = classloader.getResourceAsStream(resourceName); + StringWriter writer = new StringWriter(); + IOUtils.copy(is, writer, "UTF-8"); + return writer.toString(); + } + + public static String stripWhitespaces(String input) { + return input.replaceAll("\\s+", ""); + } + +} diff --git a/dataformat-rdf/src/test/resources/AASFull.ttl b/dataformat-rdf/src/test/resources/AASFull.ttl new file mode 100644 index 000000000..8c11c4546 --- /dev/null +++ b/dataformat-rdf/src/test/resources/AASFull.ttl @@ -0,0 +1,354 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + +# AAS Environment + rdf:type aas:Environment ; + ; + ; + ; +. + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "MaxRotationSpeed"^^xs:string ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "PARAMETER"^^xs:string ; + "0173-1#02-BAA120#008"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Max. rotation speed"@en, "max. Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; + . + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "RotationSpeed"^^xs:string ; + rdfs:label "RotationSpeed"^^xs:string ; + "PROPERTY"^^xs:string ; + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] . + + rdf:type aas:DataSpecificationIEC61360 ; + "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Document"^^xs:string ; + rdfs:label "Document"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Document"@en, "Dokument"@de ; + "Document"@en ; + "[ISO 15519-1:2010]"^^xs:string ; + ; + "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Title"^^xs:string ; + rdfs:label "Title"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; + . + + rdf:type aas:DataSpecificationIEC61360 ; + "Titel"@en, "Titel"@de ; + "Titel"@en ; + ; + "Sprachabhängiger Titel des Dokuments."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "DigitalFile"^^xs:string ; + rdfs:label "DigitalFile"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + + rdf:type aas:DataSpecificationIEC61360 ; + "Digital File"@en ; + "DigitalFile"@en ; + ; + "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt new file mode 100644 index 000000000..65b752bdc --- /dev/null +++ b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt @@ -0,0 +1,16 @@ + . + "ExampleMotor"^^ . + "ExampleMotor"^^ . + "A very short description of the AAS instance"@en . + "A very short description of the AAS instance."^^ . + "https://customer.com/aas/9175_7013_7091_9168"^^ . + _:AssetInformation . +_:AssetInformation . +_:AssetInformation _:GlobalAssetId . +_:AssetInformation . +_:GlobalAssetId . +_:GlobalAssetId . +_:GlobalAssetId _:Key . +_:Key . +_:Key . +_:Key "https://customer.com/assets/KHBVZJSQKIY"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl new file mode 100644 index 000000000..e22b250fd --- /dev/null +++ b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl @@ -0,0 +1,27 @@ +@prefix : . +@prefix aas: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; +. diff --git a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl new file mode 100644 index 000000000..e5f25bfe6 --- /dev/null +++ b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl @@ -0,0 +1,56 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Complete_Example.ttl b/dataformat-rdf/src/test/resources/Complete_Example.ttl new file mode 100644 index 000000000..0c800f8d1 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Complete_Example.ttl @@ -0,0 +1,347 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + +# Asset Administration Shell + rdf:type aas:AssetAdministrationShell ; + "ExampleMotor"^^xs:string ; + rdfs:label "ExampleMotor"^^xs:string ; + "A very short description of the AAS instance"@en ; + rdfs:comment "A very short description of the AAS instance."^^xs:string ; + "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; + [ + rdf:type ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] ; + ] ; + ; + ]; + + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ] + ]; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; + ] + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "MaxRotationSpeed"^^xs:string ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "PARAMETER"^^xs:string ; + "0173-1#02-BAA120#008"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Max. rotation speed"@en, "max. Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; + . + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "RotationSpeed"^^xs:string ; + rdfs:label "RotationSpeed"^^xs:string ; + "PROPERTY"^^xs:string ; + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] . + + rdf:type aas:DataSpecificationIEC61360 ; + "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; + "1/min"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#05-AAA650#002"^^xs:string ; + ] ; + ] ; + ; + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; +. + + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Document"^^xs:string ; + rdfs:label "Document"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + rdf:type aas:DataSpecificationIEC61360 ; + "Document"@en, "Dokument"@de ; + "Document"@en ; + "[ISO 15519-1:2010]"^^xs:string ; + ; + "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "Title"^^xs:string ; + rdfs:label "Title"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; + . + + rdf:type aas:DataSpecificationIEC61360 ; + "Titel"@en, "Titel"@de ; + "Titel"@en ; + ; + "Sprachabhängiger Titel des Dokuments."@de ; +. + +# ConceptDescription + rdf:type aas:ConceptDescription ; + "DigitalFile"^^xs:string ; + rdfs:label "DigitalFile"^^xs:string ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; + [ + rdf:type aas:EmbeddedDataSpecification ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; + ] ; + ] ; + ; + ] ; +. + + + rdf:type aas:DataSpecificationIEC61360 ; + "Digital File"@en ; + "DigitalFile"@en ; + ; + "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Overall-Example.nt b/dataformat-rdf/src/test/resources/Overall-Example.nt new file mode 100644 index 000000000..3921c9aff --- /dev/null +++ b/dataformat-rdf/src/test/resources/Overall-Example.nt @@ -0,0 +1,253 @@ + . + "ExampleMotor"^^ . + "ExampleMotor"^^ . + "A very short description of the AAS instance"@en . + "A very short description of the AAS instance."^^ . + "https://customer.com/aas/9175_7013_7091_9168"^^ . + _:AssetInformation . + _:Submodel1 . + _:Submodel2 . + _:Submodel3 . +_:AssetInformation . +_:AssetInformation _:GlobalAssetId1 . +_:AssetInformation . +_:GlobalAssetId1 . +_:GlobalAssetId1 . +_:GlobalAssetId1 _:Key1 . +_:Key1 . +_:Key1 . +_:Key1 "https://customer.com/assets/KHBVZJSQKIY"^^ . +_:Submodel1 . +_:Submodel1 . +_:Submodel1 _:Key2 . +_:Key2 . +_:Key2 . +_:Key2 "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . +_:Submodel2 . +_:Submodel2 . +_:Submodel2 _:Key3 . +_:Key3 . +_:Key3 . +_:Key3 "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . +_:Submodel3 . +_:Submodel3 . +_:Submodel3 _:Key4 . +_:Key4 . +_:Key4 . +_:Key4 "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^ . + . + "TechnicalData"^^ . + "TechnicalData"^^ . + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . + . + _:SemanticId1 . + _:SubmodelElement1 . +_:SemanticId1 . +_:SemanticId1 . +_:SemanticId1 _:Key5 . +_:Key5 . +_:Key5 . +_:Key5 "0173-1#01-AFZ615#016"^^ . +_:SubmodelElement1 . +_:SubmodelElement1 "MaxRotationSpeed"^^ . +_:SubmodelElement1 "MaxRotationSpeed"^^ . +_:SubmodelElement1 . +_:SubmodelElement1 _:ValueId1 . +_:SubmodelElement1 "5000"^^ . +_:ValueId1 . +_:ValueId1 . +_:ValueId1 _:Key6 . +_:Key6 . +_:Key6 . +_:Key6 "0173-1#02-BAA120#008"^^ . + . + "OperationalData"^^ . + "OperationalData"^^ . + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . + . + _:SubmodelElement2 . +_:SubmodelElement2 . +_:SubmodelElement2 "RotationSpeed"^^ . +_:SubmodelElement2 "RotationSpeed"^^ . +_:SubmodelElement2 . +_:SubmodelElement2 . +_:SubmodelElement2 _:ValueId2 . +_:SubmodelElement2 "4370"^^ . +_:ValueId2 . +_:ValueId2 . +_:ValueId2 _:Key7 . +_:Key7 . +_:Key7 . +_:Key7 "http://customer.com/cd/1/1/18EBD56F6B43D895"^^ . + . + "Documentation"^^ . + "Documentation"^^ . + " . + . + _:SubmodelElement3 . +_:SubmodelElement3 . +_:SubmodelElement3 "OperatingManual"^^ . +_:SubmodelElement3 "OperatingManual"^^ . +_:SubmodelElement3 _:SemanticIdListElement1 . +_:SubmodelElement3 . +_:SubmodelElement3 _:Value1 . +_:SubmodelElement3 _:Value3 . +_:SubmodelElement3 . +_:SemanticIdListElement1 . +_:SemanticIdListElement1 . +_:SemanticIdListElement1 _:Key8 . +_:Key8 . +_:Key8 . +_:Key8 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . +_:Value1 . +_:Value1 _:Value2 . +_:Value2 . +_:Value2 . +_:Value2 "Title"^^ . +_:Value2 "application/pdf" . +_:Value2 "file:///aas/OperatingManual.pdf"^^ . +_:Value2 "Title"^^ . +_:Value2 "CONSTANT"^^ . +_:Value2 _:SemanticId2 . +_:Value2 . +_:SemanticId2 . +_:SemanticId2 . +_:SemanticId2 _:Key9 . +_:Key9 . +_:Key9 . +_:Key9 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . +_:Value3 . +_:Value3 _:Value4 . +_:Value4 . +_:Value4 . +_:Value4 "DigitalFile_PDF"^^ . +_:Value4 "application/pdf" . +_:Value4 "file:///aasx/OperatingManual.pdf"^^ . +_:Value4 "DigitalFile_PDF"^^ . +_:Value4 "CONSTANT"^^ . +_:Value4 _:SemanticId3. +_:Value4 . +_:SemanticId3 . +_:SemanticId3 . +_:SemanticId3 _:Key10 . +_:Key10 . +_:Key10 . +_:Key10 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^ . + . + "MaxRotationSpeed"^^ . + "MaxRotationSpeed"^^ . + "PARAMETER"^^ . + "0173-1#02-BAA120#008"^^ . + _:EmbeddedDataSpecification1 . +_:EmbeddedDataSpecification1 . +_:EmbeddedDataSpecification1 _:DataSpecification1 . +_:EmbeddedDataSpecification1 . +_:DataSpecification1 . +_:DataSpecification1 . +_:DataSpecification1 _:Key11 . +_:Key11 . +_:Key11 . +_:Key11 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Max. rotation speed"@en . + "max. Drehzahl"@de . + "1/min"^^ . + _:UnitId1 . + . + "H\u00F6chste zul\u00E4ssige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de . + "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en . +_:UnitId1 . +_:UnitId1 . +_:UnitId1 _:Key12 . +_:Key12 . +_:Key12 . +_:Key12 "0173-1#05-AAA650#002"^^ . + . + "RotationSpeed"^^ . + "RotationSpeed"^^ . + "PROPERTY"^^ . + "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^ . + _:EmbeddedDataSpecification2 . +_:EmbeddedDataSpecification2 . +_:EmbeddedDataSpecification2 _:DataSpecification2 . +_:EmbeddedDataSpecification2 . +_:DataSpecification2 . +_:DataSpecification2 . +_:DataSpecification2 _:Key13 . +_:Key13 . +_:Key13 . +_:Key13 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Actual rotation speed"@en . + "Aktuelle Drehzahl"@de . + "1/min"^^ . + _:UnitId2 . + . + "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de . + "Actual rotation speed with which the motor or feeding unit is operated."@en . +_:UnitId2 . +_:UnitId2 . +_:UnitId2 _:Key14 . +_:Key14 . +_:Key14 . +_:Key14 "0173-1#05-AAA650#002"^^ . + . + "Document"^^ . + "Document"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . + _:EmbeddedDataSpecification3 . +_:EmbeddedDataSpecification3 . +_:EmbeddedDataSpecification3 _:DataSpecification3 . +_:EmbeddedDataSpecification3 . +_:DataSpecification3 . +_:DataSpecification3 . +_:DataSpecification3 _:Key15 . +_:Key15 . +_:Key15 . +_:Key15 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Document"@en . + "Dokument"@de . + "Document"@en . + "[ISO 15519-1:2010]"^^ . + . + "Feste und geordnete Menge von f\u00FCr die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de . + . + "Title"^^ . + "Title"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . + _:EmbeddedDataSpecification4 . +_:EmbeddedDataSpecification4 . +_:EmbeddedDataSpecification4 _:DataSpecification4 . +_:EmbeddedDataSpecification4 . +_:DataSpecification4 . +_:DataSpecification4 . +_:DataSpecification4 _:Key16 . +_:Key16 . +_:Key16 . +_:Key16 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Titel"@en . + "Titel"@de . + "Titel"@en . + . + "Sprachabh\u00E4ngiger Titel des Dokuments."@de . + . + "DigitalFile"^^ . + "DigitalFile"^^ . + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^ . + _:EmbeddedDataSpecification5 . +_:EmbeddedDataSpecification5 . +_:EmbeddedDataSpecification5 _:DataSpecification5 . +_:EmbeddedDataSpecification5 . +_:DataSpecification5 . +_:DataSpecification5 . +_:DataSpecification5 _:Key17 . +_:Key17 . +_:Key17 . +_:Key17 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . + . + "Digital File"@en . + "DigitalFile"@en . + . + "Eine Datei, die die DocumentVersion repr\u00E4sentiert. Neben der obligatorischen PDF/A Datei k\u00F6nnen weitere Dateien angegeben werden."@de . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/ReferenceExample.ttl b/dataformat-rdf/src/test/resources/ReferenceExample.ttl new file mode 100644 index 000000000..a18db83e5 --- /dev/null +++ b/dataformat-rdf/src/test/resources/ReferenceExample.ttl @@ -0,0 +1,18 @@ +@prefix xs: . + +# 1) Reference with KeyElements + a ; + [ + a ; + ; + [ + a ; + ; + [ + a ; + ; + "http://customer.com/assets/KHBVZJSQKIY"^^xs:string ; + ] + ] + ] ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl new file mode 100644 index 000000000..3e50807d6 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl @@ -0,0 +1,137 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "OperationalData"^^xs:string ; + rdfs:label "OperationalData"^^xs:string ; + "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; + ; + + [ + rdf:type aas:Property ; + rdfs:label "RotationSpeed"^^xs:string ; + "RotationSpeed"^^xs:string ; + ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; + ] + + ]; + "4370"^^xs:string ; + ]; +. + +# Submodel + rdf:type aas:Submodel ; + "Documentation"^^xs:string ; + rdfs:label "Documentation"^^xs:string ; + " ; + [ + rdf:type aas:SubmodelElementList ; + "OperatingManual"^^xs:string ; + rdfs:label "OperatingManual"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; + ] + ] ; + ; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type ; + rdf:subject ; + rdfs:label "Title"^^xs:string ; + "application/pdf" ; + "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO + "Title"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; + ] + ] ; + ; + ] + ]; + [ + rdf:type aas:SubmodelElementCollection ; + [ + rdf:type aas:File; + rdf:subject ; + rdfs:label "DigitalFile_PDF"^^xs:string ; + "application/pdf" ; + "file:///aasx/OperatingManual.pdf"^^xs:string ; + "DigitalFile_PDF"^^xs:string ; + "CONSTANT"^^xs:string ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; + ] + ] ; + ; + ]; + ] ; + ; + ] ; +. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt new file mode 100644 index 000000000..2733f1131 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt @@ -0,0 +1,25 @@ + . + "TechnicalData"^^ . + "TechnicalData"^^ . + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . + . + _:SemanticId . + _:SubmodelElements . +_:SemanticId . +_:SemanticId . +_:SemanticId _:Key1 . +_:Key1 . +_:Key1 . +_:Key1 "0173-1#01-AFZ615#016"^^ . +_:SubmodelElements . +_:SubmodelElements "MaxRotationSpeed"^^ . +_:SubmodelElements "MaxRotationSpeed"^^ . +_:SubmodelElements . +_:SubmodelElements _:ValueId . +_:SubmodelElements "5000"^^ . +_:ValueId . +_:ValueId . +_:ValueId _:Key2 . +_:Key2 . +_:Key2 . +_:Key2 "0173-1#02-BAA120#008"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl new file mode 100644 index 000000000..9c1d7f8c4 --- /dev/null +++ b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl @@ -0,0 +1,42 @@ +@prefix aas: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix xs: . + + + +# Submodel + rdf:type aas:Submodel ; + "TechnicalData"^^xs:string ; + rdfs:label "TechnicalData"^^xs:string ; + "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#01-AFZ615#016"^^xs:string ; + ] ; + ] ; + + + [ + rdf:type aas:Property ; + rdfs:label "MaxRotationSpeed"^^xs:string ; + "MaxRotationSpeed"^^xs:string ; + ; + [ + rdf:type aas:Reference ; + ; + [ + rdf:type aas:Key ; + ; + "0173-1#02-BAA120#008"^^xs:string ; + ] ; + ]; + "5000"^^xs:string ; + ]; +. diff --git a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld new file mode 100644 index 000000000..7eac7fa6c --- /dev/null +++ b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld @@ -0,0 +1,88 @@ +{ + "@context" : { + "aas" : "https://admin-shell.io/aas/3/0/RC02/" + }, + "@id" : "https://admin-shell.io/autogen/DefaultEnvironment/7e646a58-7419-41e2-99e8-163a7abb7b46", + "@type" : "aas:Environment", + "https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultAssetAdministrationShell/b869a629-8d69-4754-9c50-804b0e9eb35a", + "@type" : "aas:AssetAdministrationShell", + "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation" : { + "@id" : "https://admin-shell.io/autogen/DefaultAssetInformation/6882a093-6831-445d-a884-f2ebc37aaa29", + "@type" : "aas:AssetInformation", + "https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind" : { + "@type" : "aas:AssetKind", + "@id" : "https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance" + }, + "https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds" : [ ] + }, + "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { + "@language" : "en-us", + "@value" : "This is a test AAS" + } ], + "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { + "@language" : "de", + "@value" : "Anzeigename 2" + }, { + "@language" : "en", + "@value" : "Display Name 1" + } ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] + } ], + "https://admin-shell.io/aas/3/0/RC02/Environment/conceptdescriptions" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultConceptDescription/14b4a819-7ca0-4cb2-b2c7-33a1c443c899", + "@type" : "aas:ConceptDescription", + "https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultDataSpecification/66cf9a6c-e656-4c95-91be-2ddc1779ec71", + "@type" : "aas:EmbeddedDataSpecification", + "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation" : { + "@id" : "https://admin-shell.io/autogen/DefaultReference/251d9f19-b36b-4c39-b517-3d7e93bd8c96", + "@type" : "aas:Reference", + "https://admin-shell.io/aas/3/0/RC02/Reference/key" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultKey/ad4e8527-e002-4776-87ca-7049e7be440f", + "@type" : "aas:Key", + "https://admin-shell.io/aas/3/0/RC02/Key/value" : "https://example.org" + } ] + } , + "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent" : { + "@id" : "https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/5319d62e-7ca1-4954-addf-76db6bf1e241", + "@type" : "aas:DataSpecificationIEC61360", + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType" : { + "@type" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/DataTypeIEC61360", + "@id" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/RATIONAL" + }, + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition" : [ ], + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName" : [ ], + "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName" : [ ] + }, + "https://admin-shell.io/aas/3/0/RC02/DataSpecification/id" : "http://example.org/DataSpecification1" + } ] + } ], + "https://admin-shell.io/aas/3/0/RC02/Environment/submodels" : [ { + "@id" : "https://admin-shell.io/autogen/DefaultSubmodel/18810336-c309-42f8-9986-438f7068f0d6", + "@type" : "aas:Submodel", + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier" : [ ], + "https://admin-shell.io/aas/3/0/RC02/Referable/category" : "Example category", + "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { + "@language" : "en-us", + "@value" : "My Submodel" + } ], + "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { + "@language" : "en", + "@value" : "First Submodel Element name" + }, { + "@language" : "en", + "@value" : "Second Submodel Element name" + } ], + "https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement" : [ ], + "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] + } ] +} \ No newline at end of file From 3037e7113d339deb5d7318fdc416282db2cbedfa Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 15:02:21 +0200 Subject: [PATCH 07/91] Update dataformat-xml project --- .../AasXmlNamespaceContext.java | 17 +- .../SubmodelElementManager.java | 34 +- .../XmlDataformatAnnotationIntrospector.java | 10 +- .../v3/dataformat/xml/XmlDeserializer.java | 130 +- .../v3/dataformat/xml/XmlSerializer.java | 111 +- ...mbeddedDataSpecificationsDeserializer.java | 41 +- .../LangStringNodeDeserializer.java | 34 + .../LangStringsDeserializer.java | 25 + .../OperationVariableDeserializer.java | 22 +- .../QualifierDeserializer.java | 16 +- .../ReferencesDeserializer.java | 6 +- .../SubmodelElementDeserializer.java | 3 +- .../SubmodelElementsDeserializer.java | 17 +- .../mixins/AssetAdministrationShellMixin.java | 12 +- .../xml/mixins/AssetInformationMixin.java | 29 +- .../xml/mixins/ConceptDescriptionMixin.java | 9 +- .../DataSpecificationIec61360Mixin.java | 73 +- .../EmbeddedDataSpecificationMixin.java | 82 +- .../v3/dataformat/xml/mixins/EntityMixin.java | 21 +- .../xml/mixins/EnvironmentMixin.java | 4 +- .../xml/mixins/HasDataSpecificationMixin.java | 10 +- .../xml/mixins/HasExtensionsMixin.java | 3 +- .../v3/dataformat/xml/mixins/KeyMixin.java | 3 +- .../xml/mixins/LangStringMixin.java | 33 + .../mixins/MultiLanguagePropertyMixin.java | 22 +- .../dataformat/xml/mixins/OperationMixin.java | 20 +- .../xml/mixins/OperationVariableMixin.java | 4 +- .../xml/mixins/QualifiableMixin.java | 10 +- .../dataformat/xml/mixins/QualifierMixin.java | 11 +- .../dataformat/xml/mixins/ReferableMixin.java | 40 +- .../dataformat/xml/mixins/ReferenceMixin.java | 3 +- .../dataformat/xml/mixins/ResourceMixin.java | 9 +- .../xml/mixins/SpecificAssetIDMixin.java | 13 +- .../SubmodelElementCollectionMixin.java | 3 +- .../xml/mixins/SubmodelElementMixin.java | 7 +- .../dataformat/xml/mixins/SubmodelMixin.java | 7 +- .../dataformat/xml/mixins/ValueListMixin.java | 18 +- .../xml/mixins/ValueReferencePairMixin.java | 11 +- .../AbstractLangStringSerializer.java | 2 +- .../AbstractLangStringsSerializer.java | 4 +- ...inistrationShellEnvironmentSerializer.java | 19 +- .../serialization/DataElementsSerializer.java | 3 +- .../EmbeddedDataSpecificationSerializer.java | 22 +- .../xml/serialization/KeySerializer.java | 47 + .../serialization/LangStringSerializer.java | 67 + .../serialization/LangStringsSerializer.java | 52 + .../OperationVariableSerializer.java | 27 +- .../serialization/ReferenceSerializer.java | 48 + .../SubmodelElementSerializer.java | 12 +- .../SubmodelElementsSerializer.java | 5 +- dataformat-xml/src/main/resources/AAS.xsd | 1937 +++++--------- .../src/main/resources/AAS_ABAC.xsd | 167 ++ .../src/main/resources/IEC61360.xsd | 145 ++ .../dataformat/xml/XMLDeserializerTest.java | 63 +- .../v3/dataformat/xml/XmlSerializerTest.java | 110 +- .../v3/dataformat/xml/XmlValidationTest.java | 5 +- ...ple_AAS_ServoDCMotor - Simplified V2.0.xml | 436 ++++ .../resources/ServoDCMotor_invalid_V2.0.xml | 470 ++++ .../annotated_relationship_example.xml | 9 +- .../src/test/resources/invalidXmlExample.xml | 2 +- dataformat-xml/src/test/resources/minimum.xml | 7 +- .../src/test/resources/operation_example.xml | 47 +- .../src/test/resources/qualifier_example.xml | 6 +- .../test/resources/test_demo_full_example.xml | 2246 ++++++++++++----- .../src/test/resources/xmlExample.xml | 170 +- .../xmlExampleWithModifiedPrefix.xml | 171 +- 66 files changed, 4376 insertions(+), 2846 deletions(-) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/AasXmlNamespaceContext.java (57%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/SubmodelElementManager.java (52%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{internal => }/XmlDataformatAnnotationIntrospector.java (90%) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java create mode 100644 dataformat-xml/src/main/resources/AAS_ABAC.xsd create mode 100644 dataformat-xml/src/main/resources/IEC61360.xsd create mode 100644 dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml create mode 100644 dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java similarity index 57% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java index 05eded296..b7e4b1287 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; import java.util.HashMap; import java.util.Map; @@ -22,7 +23,16 @@ public class AasXmlNamespaceContext { public static final String AAS_PREFERRED_PREFIX = "aas"; - public static final String AAS_URI = "https://admin-shell.io/aas/3/0"; + public static final String AAS_URI = "https://admin-shell.io/aas/3/0/RC02"; + + public static final String ABAC_PREFERRED_PREFIX = "abac"; + public static final String ABAC_URI = "http://www.admin-shell.io/aas/abac/3/0"; + + public static final String COMMON_PREFERRED_PREFIX = "aas_common"; + public static final String COMMON_URI = "http://www.admin-shell.io/aas_common/3/0"; + + public static final String IEC61360_PREFERRED_PREFIX = "IEC61360"; + public static final String IEC61360_URI = "http://www.admin-shell.io/IEC61360/3/0"; public static final String XSI_PREFERRED_PREFIX = "xsi"; public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; @@ -31,6 +41,9 @@ public class AasXmlNamespaceContext { static { PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); + PREFERRED_PREFIX_CONTEXT.put(ABAC_PREFERRED_PREFIX, ABAC_URI); + PREFERRED_PREFIX_CONTEXT.put(COMMON_PREFERRED_PREFIX, COMMON_URI); + PREFERRED_PREFIX_CONTEXT.put(IEC61360_PREFERRED_PREFIX, IEC61360_URI); PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java similarity index 52% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java index dc4dbda68..e2a29a42b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,34 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEventPayload; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; - public class SubmodelElementManager { public static Map, String> CLASS_TO_NAME = new HashMap<>(); @@ -61,13 +42,8 @@ public class SubmodelElementManager { CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); CLASS_TO_NAME.put(DefaultOperation.class, "operation"); CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); - CLASS_TO_NAME.put(DefaultLangStringTextType.class, "langStringTextType"); - CLASS_TO_NAME.put(DefaultLangStringNameType.class, "langStringNameType"); - CLASS_TO_NAME.put(DefaultLangStringDefinitionTypeIec61360.class, "langStringDefinitionTypeIec61360"); - CLASS_TO_NAME.put(DefaultLangStringPreferredNameTypeIec61360.class, "langStringPreferredNameTypeIec61360"); - CLASS_TO_NAME.put(DefaultLangStringShortNameTypeIec61360.class, "langStringShortNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangString.class, "langString"); CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); - CLASS_TO_NAME.put(DefaultSubmodelElementList.class, "submodelElementList"); NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java index 0b886d776..4e157a834 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; import java.util.Collection; @@ -24,7 +25,7 @@ import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; /** * This class helps to dynamically decide how to de-/serialize classes and @@ -45,9 +46,8 @@ public XmlDataformatAnnotationIntrospector() { myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; } - @Override public String findNamespace(MapperConfig config, Annotated ann) { - String ns = super.findNamespace(null, ann); + String ns = super.findNamespace(config, ann); if (ns == null) { return myDefaultNamespace; } else { @@ -60,7 +60,7 @@ public String[] findSerializationPropertyOrder(AnnotatedClass ac) { String[] order = super.findSerializationPropertyOrder(ac); if (order == null) { order = new String[] { - "extensions", "idShort", "displayName", "category", "description", "administration", "identification", "kind", "semanticId", + "extensions", "idShort", "displayNames", "category", "descriptions", "administration", "identification", "kind", "semanticId", "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index 42ec3687b..cdbafe570 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,54 +16,37 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.Map; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -public class XmlDeserializer { +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +public class XmlDeserializer implements Deserializer { - protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - @SuppressWarnings("rawtypes") - protected static Map, JsonDeserializer> customDeserializers = Map.of( + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( SubmodelElement.class, new SubmodelElementDeserializer()); - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - public XmlDeserializer() { - this(new XmlFactory()); - } - - public XmlDeserializer(XmlFactory xmlFactory) { - this.xmlFactory = xmlFactory; initTypeResolver(); buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder(xmlFactory) - .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + mapper = XmlMapper.builder().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .serializationInclusion(JsonInclude.Include.NON_NULL) .annotationIntrospector(new XmlDataformatAnnotationIntrospector()) @@ -79,8 +63,7 @@ protected SimpleModule buildCustomDeserializerModule() { return module; } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() @@ -100,15 +83,7 @@ protected SimpleModule buildImplementationModule() { return module; } - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { return mapper.readValue(value, Environment.class); @@ -117,82 +92,7 @@ public Environment read(String value) throws DeserializationException { } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index e7b28aafa..419f9632a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +16,19 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.Map; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.OperationVariableSerializer; +// TODO import io.adminshell.aas.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import com.fasterxml.jackson.annotation.JsonInclude; @@ -35,34 +37,25 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -public class XmlSerializer { - protected final XmlFactory xmlFactory; +public class XmlSerializer implements Serializer { protected XmlMapper mapper; protected Map namespacePrefixes; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public XmlSerializer() { this(null); } public XmlSerializer(Map namespacePrefixes) { - this(new XmlFactory(), namespacePrefixes); - } - - public XmlSerializer(XmlFactory xmlFactory, Map namespacePrefixes) { - this.xmlFactory = xmlFactory; this.namespacePrefixes = namespacePrefixes; buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder(xmlFactory) + mapper = XmlMapper.builder() .enable(SerializationFeature.INDENT_OUTPUT) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) @@ -77,6 +70,7 @@ protected void buildMapper() { protected SimpleModule buildCustomSerializerModule() { SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); AssetAdministrationShellEnvironmentSerializer aasEnvSerializer; if (namespacePrefixes != null) { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(namespacePrefixes); @@ -84,7 +78,11 @@ protected SimpleModule buildCustomSerializerModule() { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(); } module.addSerializer(Environment.class, aasEnvSerializer); - module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); +// module.addSerializer(Key.class, new KeySerializer()); +// module.addSerializer(Reference.class, new ReferenceSerializer()); + module.addSerializer(LangString.class, new LangStringSerializer()); +// module.addSerializer(new LangStringsSerializer()); +module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); return module; } @@ -94,15 +92,7 @@ protected SimpleModule buildEnumModule() { return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { ObjectWriter writer = mapper.writer(); @@ -111,73 +101,4 @@ public String write(Environment aasEnvironment) throws SerializationException { throw new SerializationException("serialization failed", ex); } } - - - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); - } - - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); - } - } - - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); - } - } - - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); - } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 1deec93b2..45caad7c9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,24 +16,29 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; -import java.io.IOException; - -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; - private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +// TODO fix the EmbeddedDataSpecification issue +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer> { @Override - public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -41,14 +47,23 @@ public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationC return createEmbeddedDataSpecificationsFromContent(parser, node); } + private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonMappingException { + if (!node.has(DataSpecificationManager.PROP_DATA_SPECIFICATION)) { + throw new JsonMappingException(parser, String.format("data specification must contain node '%s'", DataSpecificationManager.PROP_DATA_SPECIFICATION)); + } + JsonNode nodeDataSpecification = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION); + return nodeDataSpecification; + } - private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); - return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); + private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); + JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); + DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); + return Collections.singletonList(content); } - private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); + private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java new file mode 100644 index 000000000..7fb61b6a4 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.JsonNode; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; + +public class LangStringNodeDeserializer implements CustomJsonNodeDeserializer { + @Override + public LangString readValue(JsonNode node, JsonParser parser) throws IOException { + String lang = node.get("language").asText(); + String text = node.get("text").asText(); + return new DefaultLangString.Builder().text(text).language(lang).build(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java new file mode 100644 index 000000000..ebc3eb0c7 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringsDeserializer extends NoEntryWrapperListDeserializer { + public LangStringsDeserializer() { + super("langString", new LangStringNodeDeserializer()); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java index 94c505b12..42f255af0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2022 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -29,10 +23,22 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.io.IOException; +import java.util.Collections; +import java.util.List; public class OperationVariableDeserializer extends JsonDeserializer> { + + public OperationVariableDeserializer() { + } + + @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); @@ -54,7 +60,7 @@ public List deserialize(JsonParser parser, DeserializationCon private List createOperationVariablesFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("operationVariable"); - return DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); + return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java index a1930c8ea..ce2d633ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java @@ -25,7 +25,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2022 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,11 +42,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -55,12 +54,20 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + public class QualifierDeserializer extends JsonDeserializer> { + + public QualifierDeserializer() { + } + + @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); + List qualifiers = new ArrayList<>(); if (!node.has("qualifier")) { return Collections.emptyList(); @@ -75,9 +82,10 @@ public List deserialize(JsonParser parser, DeserializationContext ctx } + @SuppressWarnings("unchecked") private List createConstraintsFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("qualifier"); - return DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); + return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java index 1fed0147e..baac7da10 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,6 @@ import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -30,12 +29,13 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + public class ReferencesDeserializer extends JsonDeserializer> { @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); - treeNode = treeNode.get("reference"); if (treeNode.isArray()) { return createReferencesFromArray(parser, (ArrayNode) treeNode); } else { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java index df65da5af..6a591795d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +26,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class SubmodelElementDeserializer extends JsonDeserializer { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java index cad350fb0..4eae88d22 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,6 @@ import java.util.Iterator; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -34,6 +33,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + public class SubmodelElementsDeserializer extends JsonDeserializer> { private SubmodelElementDeserializer deserializer = new SubmodelElementDeserializer(); @@ -56,7 +57,8 @@ public List deserialize(JsonParser parser, DeserializationConte } private List createSubmodelElements(JsonParser parser, DeserializationContext ctxt, TreeNode treeNode) throws IOException, JsonProcessingException { - if (treeNode.isArray()) { +// JsonNode nodeSubmodelElement = getSubmodelElementsNode(treeNode); + if (treeNode.isArray()) { return getSubmodelElementsFromArrayNode(parser, ctxt, (ArrayNode) treeNode); } else { return getSubmodelElementsFromObjectNode(parser, ctxt, (JsonNode) treeNode); @@ -89,6 +91,12 @@ private List getSubmodelElementsFromObjectNode(JsonParser parse return submodelElements; } + private JsonNode getSubmodelElementsNode(TreeNode temp) { + ObjectNode objNode = (ObjectNode) temp; + JsonNode nodeSubmodelElement = objNode.get("submodelElement"); // TODO: most likely the node will have the name of a SME subclass, e.g. "property" and not "submodelElement" + return nodeSubmodelElement; + } + private List getSubmodelElementsFromArrayNode(JsonParser parser, DeserializationContext ctxt, ArrayNode arrayNode) throws IOException, JsonProcessingException { List elements = new ArrayList<>(); for (int i = 0; i < arrayNode.size(); i++) { @@ -101,7 +109,8 @@ private List getSubmodelElementsFromArrayNode(JsonParser parser private SubmodelElement getSubmodelElementFromJsonNode(JsonParser parser, DeserializationContext ctxt, JsonNode nodeSubmodelElement) throws IOException, JsonProcessingException { JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeSubmodelElement); - return deserializer.deserialize(parserReference, ctxt); + SubmodelElement elem = deserializer.deserialize(parserReference, ctxt); + return elem; } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java index 1e2728ed4..686afa6da 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +18,20 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + @JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "dataSpecifications", "embeddedDataSpecifications", "derivedFrom", "assetInformation", "submodels"}) public interface AssetAdministrationShellMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") - public String getID(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") //TODO move into IdentifiableMixin + public String getId(); @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodels") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index 1ab503390..d4b2af09f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,27 +18,40 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + @JsonPropertyOrder({ "assetKind", "globalAssetId", "specificAssetIds", "defaultThumbnail"}) public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public String getGlobalAssetID(); + public Reference getGlobalAssetId(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + public void setGlobalAssetId(Reference globalAssetId); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") + public List getBillOfMaterials(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") + public void setBillOfMaterials(List billOfMaterials); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "defaultThumbnail") public File getDefaultThumbnail(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java index 1081f1130..22b084d81 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,24 +18,26 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + @JsonPropertyOrder({"hasExtension", "category", "idShort", "displayName", "description", "checksum", "administration", "id", "embeddedDataSpecification", "isCaseOf"}) public interface ConceptDescriptionMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") + // @JsonDeserialize(using = ReferencesDeserializer.class) public List getIsCaseOf(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") + // @JsonDeserialize(using = ReferencesDeserializer.class) public void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index eefb98b28..7698c1926 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,60 +16,45 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsDefinitionTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsPreferredNameTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsShortNameTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.*; -@JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -public interface DataSpecificationIec61360Mixin { +import java.util.List; - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - @JsonSerialize(using = LangStringsDefinitionTypeIec61360Serializer.class) - public List getDefinition(); +@JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) +//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") +public interface DataSpecificationIEC61360Mixin { + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + public List getDefinition(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - @JsonDeserialize(using = LangStringsDefinitionTypeIec61360Deserializer.class) - public void setDefinition(List definition); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + public void setDefinition(List definition); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") public LevelType getLevelType(); + // TODO +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") + // public void setLevelTypes(List levelTypes); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - @JsonSerialize(using = LangStringsPreferredNameTypeIec61360Serializer.class) - public List getPreferredName(); +// @JsonInclude(JsonInclude.Include.ALWAYS) + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + public List getPreferredName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - @JsonDeserialize(using = LangStringsPreferredNameTypeIec61360Deserializer.class) - public void setPreferredName(List preferredName); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + public void setPreferredName(List preferredName); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - @JsonSerialize(using = LangStringsShortNameTypeIec61360Serializer.class) - public List getShortName(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + public List getShortName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - @JsonDeserialize(using = LangStringsShortNameTypeIec61360Deserializer.class) - public void setShortName(List shortName); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + public void setShortName(List shortName); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "sourceOfDefinition") public String getSourceOfDefinition(); @@ -80,7 +66,7 @@ public interface DataSpecificationIec61360Mixin { public String getUnit(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "unitId") - public Reference getUnitID(); + public Reference getUnitId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueFormat") public String getValueFormat(); @@ -91,16 +77,11 @@ public interface DataSpecificationIec61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") public ValueList getValueList(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") - public void setValueList(ValueList valueList); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIec61360 getDataType(); - - + public DataTypeIEC61360 getDataType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 8832434c2..3b5bfe6fe 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -1,46 +1,36 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.EmbeddedDataSpecificationsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) -public interface EmbeddedDataSpecificationMixin { - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public Reference getDataSpecification(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public void setDataSpecification(Reference dataSpecification); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationContent getDataSpecificationContent(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonDeserialize(using = EmbeddedDataSpecificationsDeserializer.class) - public void setDataSpecificationContent(DataSpecificationContent dataSpecificationIEC61360); - -} +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) +public interface EmbeddedDataSpecificationMixin { + + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public Reference getDataSpecification(); + + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) + public DataSpecificationIEC61360 getDataSpecificationContent(); + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java index 461fb73c5..fbe80a98b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,23 +18,25 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + public interface EntityMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") + public SpecificAssetId getExternalAssetId(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") - @JsonInclude(JsonInclude.Include.NON_NULL) +// @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") + @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = SubmodelElementsSerializer.class) @JsonDeserialize(using = SubmodelElementsDeserializer.class) public List getStatements(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java index 9ccd1bfc1..2d474410e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +18,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java index 7e801c9e1..ee1c5d64a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +16,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; - import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; + +import java.util.List; public interface HasDataSpecificationMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java index f4489b4f7..7f89ab25d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +21,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; public interface HasExtensionsMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java index 34e5864a5..70eee5159 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; @JsonPropertyOrder({"type", "value"}) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java new file mode 100644 index 000000000..8bf691b20 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + + +@JsonPropertyOrder({"language", "text"}) +public interface LangStringMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "language") + public String getLanguage(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "text") + public String getText(); +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java index da43b241a..2c9242316 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,21 +18,16 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -public interface MultiLanguagePropertyMixin { - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "langStringTextType") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public List getValue(); +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - void setValueID(Reference valueID); +public interface MultiLanguagePropertyMixin { + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") +// @JsonSerialize(using = LangStringsSerializer.class) + @JsonDeserialize(using = LangStringsDeserializer.class) + public List getValue(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java index cb5002f92..5b93072b3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,21 +18,36 @@ import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.OperationVariableDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - public interface OperationMixin { + //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inputVariables") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") public List getInputVariables(); + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInputVariables(List inputVariables); + + // @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") + // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") + public List getInoutputVariables(); + @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInoutputVariables(List inoutputVariables); + + //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") + // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") + //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") + public List getOutputVariables(); + @JsonDeserialize(using = OperationVariableDeserializer.class) public void setOutputVariables(List outputVariables); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java index 91af44668..191ab7379 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +20,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java index 0028e520d..3d5ef989c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +18,18 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + public interface QualifiableMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifiers") @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifier") + // TODO @JsonSerialize(using = ConstraintsSerializer.class) @JsonDeserialize(using = QualifierDeserializer.class) public List getQualifiers(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index 6d9a72164..f3ad9cb5d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; - @JsonPropertyOrder({ "semanticId", "supplementalSemanticIds", // --> HasSemantics "kind", "type", "valueType", "value", "valueId" @@ -37,7 +36,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXsd valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 552eb1d3e..88ef3306c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,37 +18,42 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + @JsonPropertyOrder({"hasExtensions", "category", "idShort", "displayName", "description", "checksum"}) public interface ReferableMixin { + +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") +// public String getCategory(); +// +// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") +// public void setCategory(String category); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsTextTypeSerializer.class) - public List getDescription(); + @JsonSerialize(using = LangStringsSerializer.class) + public List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public void setDescription(List descriptions); + @JsonDeserialize(using = LangStringsDeserializer.class) + public void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - public List getDisplayName(); +// @JsonSerialize(using = LangStringsSerializer.class) + @JsonDeserialize(using = LangStringsDeserializer.class) + public List getDisplayName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonSerialize(using = LangStringsNameTypeSerializer.class) - public void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + public void setDisplayName(List displayNames); +// @JsonInclude(JsonInclude.Include.ALWAYS) public String getIdShort(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java index 41d8dce6c..9347321b0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.KeysDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index ef49d195c..4f5025748 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; @JsonPropertyOrder({"path", "contentType"}) public interface ResourceMixin { @@ -29,5 +28,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXsd getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 511735600..3d9ee0220 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -@JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIDMixin { +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +@JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) +public interface SpecificAssetIdMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -31,5 +32,5 @@ public interface SpecificAssetIDMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectID(); + public Reference getExternalSubjectId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java index 102e1f4d8..a7d285c1f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +22,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java index 4992fb50f..4610a971f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,14 +18,12 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; - @JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable + "hasExtensions", "category", "idShort", "displayNames", "description", "checksum", // --> Referable "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics + "semanticId", "supplementalSemanticIds", // --> HasSemantics "qualifier", // --> Qualifiable "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications - "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List "valueType", "value", "valueId" // --> Property , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity , "first", "second", "annotations" // --> (Annotated)RelationsShipElement diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java index bcb0845e9..c62d7a497 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +23,14 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", "embeddedDataSpecifications", "submodelElements"}) +@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", + "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", + "embeddedDataSpecifications", "submodelElements"}) public interface SubmodelMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelElements") @JsonSerialize(using = SubmodelElementsSerializer.class) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java index d13a78bbb..7a0550db6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ValueReferencePairsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; + +import java.util.List; public interface ValueListMixin { @@ -31,9 +30,4 @@ public interface ValueListMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") List getValueReferencePairs(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePairs") - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") - @JsonDeserialize(using = ValueReferencePairsDeserializer.class) - public void setValueReferencePairs(List valueReferencePair); - } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java index 52fc57b22..a8a3544d7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,16 +16,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -@JsonPropertyOrder({ "value", "valueID" }) +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +@JsonPropertyOrder({"value", "valueId"}) public interface ValueReferencePairMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - public Reference getValueID(); + public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") public String getValue(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java index 8f2e2c085..cd4e5d2e1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java @@ -24,7 +24,7 @@ import javax.xml.namespace.QName; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java index 6ba166590..1cdf8e20e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * + * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java index 08a2ca10e..e1b1ac179 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,22 +25,22 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + public class AssetAdministrationShellEnvironmentSerializer extends JsonSerializer { private static final String[] SCHEMA_LOCATION = {"xsi:schemaLocation", - "https://admin-shell.io/aas/3/0 AAS.xsd" }; + "https://admin-shell.io/aas/3/0/RC02 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd"}; private static final QName AASENV_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "environment"); private static final QName AASLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assetAdministrationShells"); @@ -48,6 +49,8 @@ public class AssetAdministrationShellEnvironmentSerializer extends JsonSerialize private static final QName CONCEPTDICTIONARY_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "conceptDescription"); private static final QName SUBMODELLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodels"); private static final QName SUBMODEL_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodel"); + private static final QName ASSETLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assets"); + private static final QName ASSET_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "asset"); private Map namespacePrefixes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java index 800e7e233..0f387ca6e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +24,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class DataElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index 1208a07d6..aa99ff032 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +16,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; -import java.io.IOException; - - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; /** @@ -31,22 +34,27 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +// TODO: solve EmbeddedDataSpecifiction issue +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { + + private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); @Override - public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } +// generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); + // TODO: Add field name according to template type generator.writeObjectField("dataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java new file mode 100644 index 000000000..8e545b727 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; + +import org.eclipse.digitaltwin.aas4j.v3.model.Key; + +public class KeySerializer extends JsonSerializer { + + @Override + public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; + xgen.writeObjectFieldStart("key"); + + String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString()); + xgen.setNextIsAttribute(false); + xgen.writeFieldName("type"); + xgen.writeString(key.getType().name()); + + xgen.setNextIsAttribute(false); + xgen.writeFieldName("value"); + xgen.writeString(key.getValue()); + + xgen.writeEndObject(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java new file mode 100644 index 000000000..1ee6cc058 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; +import java.lang.reflect.Field; + +import javax.xml.namespace.QName; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +public class LangStringSerializer extends JsonSerializer { + + + @Override + public void serialize(LangString langString, JsonGenerator gen, SerializerProvider serializers) throws IOException { + + ToXmlGenerator xgen = (ToXmlGenerator) gen; + try { + Field nextName = xgen.getClass().getDeclaredField("_nextName"); + nextName.setAccessible(true); + QName next = (QName) nextName.get(xgen); + + xgen.setNextName(new QName(AasXmlNamespaceContext.AAS_URI, "langString")); + + serializeLangString(xgen, langString); + + } catch (NoSuchFieldException | IllegalAccessException e) { + // serialize it without changing the namespaces + serializeLangString(xgen, langString); + } + + } + + private void serializeLangString(ToXmlGenerator xgen, LangString langString) throws IOException { + + + xgen.writeStartObject(); + xgen.writeFieldName("language"); + xgen.writeString(langString.getLanguage()); + + xgen.writeFieldName("text"); + xgen.writeString(langString.getText()); + + xgen.writeEndObject(); + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java new file mode 100644 index 000000000..2282408e6 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.io.IOException; +import java.util.List; + +public class LangStringsSerializer extends NoEntryWrapperListSerializer { + + private LangStringSerializer ser = new LangStringSerializer(); + + @Override + public void serialize(List langStrings, JsonGenerator gen, SerializerProvider serializers) throws IOException { + + ToXmlGenerator xgen = (ToXmlGenerator) gen; + xgen.writeStartObject(); + for (LangString element : langStrings) { + ReflectionHelper.setEmptyListsToNull(element); // call is needed to prevent empty tags (e.g. statements.size=0 leads to , which is not allowed according to the schema + xgen.writeFieldName(SubmodelElementManager.getXmlName(element.getClass())); + ser.serialize(element, xgen, serializers); + } + xgen.writeEndObject(); + + } + + @Override + public Class> handledType() { + return (Class>)(Object)List.class; + } + +} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java index 5ca546993..306dcccec 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +16,22 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; -import java.io.IOException; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import java.io.IOException; public class OperationVariableSerializer extends JsonSerializer { + + private SubmodelElementSerializer ser = new SubmodelElementSerializer(); + @Override public void serialize(OperationVariable operationVariable, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeStartObject(); xgen.writeFieldName("operationVariable"); @@ -41,4 +45,17 @@ public void serialize(OperationVariable operationVariable, JsonGenerator gen, Se xgen.writeEndObject(); } + + private void serializeOperationVariable(ToXmlGenerator xgen, OperationVariable operationVariable) throws IOException { + + + xgen.writeStartObject(); +// xgen.writeFieldName("language"); +// xgen.writeString(langString.getLanguage()); +// +// xgen.writeFieldName("text"); +// xgen.writeString(langString.getText()); + + xgen.writeEndObject(); + } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java new file mode 100644 index 000000000..419a36ef7 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; + +import java.io.IOException; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +public class ReferenceSerializer extends JsonSerializer { + private NoEntryWrapperListSerializer keyListSerializer; + + public ReferenceSerializer() { +// this.keyListSerializer = new NoEntryWrapperListSerializer<>(); +// this.keyListSerializer.setOuterWrapper("keys"); + } + + @Override + public void serialize(Reference reference, JsonGenerator gen, SerializerProvider serializers) throws IOException { + ToXmlGenerator xgen = (ToXmlGenerator) gen; +// xgen.setNextIsUnwrapped(true); +// xgen.writeObjectFieldStart("type"); + xgen.writeString(reference.getType().name()); + +// List keys = reference.getKeys(); +// this.keyListSerializer.serialize(keys, gen, serializers); + } + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java index 39c94f386..df63759c8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +19,16 @@ import java.io.IOException; import java.lang.reflect.Field; -import javax.xml.namespace.QName; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import javax.xml.namespace.QName; + public class SubmodelElementSerializer extends JsonSerializer { @Override @@ -46,6 +47,7 @@ public void serialize(SubmodelElement value, JsonGenerator gen, SerializerProvid return ; } } catch (NoSuchFieldException | IllegalAccessException e) { + // TODO: report exception throw new IOException(e); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java index 6b119a711..2b77c753d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +24,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.*; public class SubmodelElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/resources/AAS.xsd b/dataformat-xml/src/main/resources/AAS.xsd index 8f8569e73..f61f1bf08 100644 --- a/dataformat-xml/src/main/resources/AAS.xsd +++ b/dataformat-xml/src/main/resources/AAS.xsd @@ -1,1346 +1,591 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dataformat-xml/src/main/resources/AAS_ABAC.xsd b/dataformat-xml/src/main/resources/AAS_ABAC.xsd new file mode 100644 index 000000000..472c60d37 --- /dev/null +++ b/dataformat-xml/src/main/resources/AAS_ABAC.xsd @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/main/resources/IEC61360.xsd b/dataformat-xml/src/main/resources/IEC61360.xsd new file mode 100644 index 000000000..b929a4304 --- /dev/null +++ b/dataformat-xml/src/main/resources/IEC61360.xsd @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index 784f3f888..3b1fce30d 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,50 +16,28 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import java.io.FileNotFoundException; -import java.util.List; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.junit.Assert; import org.junit.Test; -public class XMLDeserializerTest { - - @Test - public void deserializeAASSimple() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); +import java.io.FileNotFoundException; +import java.util.List; - Assert.assertEquals(AASSimple.createEnvironment(), env); - } +public class XMLDeserializerTest { @Test - public void deserializeAASSimpleAAS() throws Exception { + public void deserializeAASSimple() throws Exception { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); - } - - @Test - public void deserializeAASSimpleSubmodel() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getSubmodels(), env.getSubmodels()); - } - - @Test - public void deserializeAASSimpleConceptDescription() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - - Assert.assertEquals(AASSimple.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); - } + Assert.assertEquals(AASSimple.ENVIRONMENT, env); + } @Test public void deserializeAnnotedRelationshipElement() throws Exception { @@ -78,7 +57,7 @@ public void deserializeQualifier() throws Exception { @Test public void deserializeOperation() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATIONS); + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATION); Assert.assertNotNull(env); OperationVariable inputVariable = ((Operation) env.getSubmodels().get(0).getSubmodelElements().get(0)).getInputVariables().get(0); @@ -94,26 +73,6 @@ public void deserializeOperation() throws Exception { @Test public void deserializeAASFull() throws FileNotFoundException, DeserializationException { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.createEnvironment(), env); + Assert.assertEquals(AASFull.ENVIRONMENT, env); } - - @Test - public void deserializeAASFullAAS() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); - } - - @Test - public void deserializeAASFullSubmodel() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - - Assert.assertEquals(AASFull.createEnvironment().getSubmodels(), env.getSubmodels()); - } - - @Test - public void deserializeAASFullConceptDescription() throws FileNotFoundException, DeserializationException { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - - Assert.assertEquals(AASFull.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); - } } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 6ca6b6c65..69cc64dd7 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - import static org.junit.Assert.assertTrue; import java.io.File; @@ -28,32 +27,24 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.hamcrest.MatcherAssert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.w3c.dom.Node; import org.xml.sax.SAXException; import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; -import org.xmlunit.util.Predicate; +import com.fasterxml.jackson.core.JsonProcessingException; public class XmlSerializerTest { public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.xml"); @@ -61,7 +52,7 @@ public class XmlSerializerTest { public static final java.io.File AASSIMPLE_FILE_WITH_TEST_NAMESPACE = new java.io.File("src/test/resources/xmlExampleWithModifiedPrefix.xml"); public static final java.io.File AASFULL_FILE_WITH_ANNOTATED_RELATIONSHIP = new java.io.File("src/test/resources/annotated_relationship_example.xml"); public static final java.io.File AASFULL_FILE_WITH_QUALIFIERS = new java.io.File("src/test/resources/qualifier_example.xml"); - public static final java.io.File AASFULL_FILE_WITH_OPERATIONS = new java.io.File("src/test/resources/operation_example.xml"); + public static final java.io.File AASFULL_FILE_WITH_OPERATION = new java.io.File("src/test/resources/operation_example.xml"); private static final Logger logger = LoggerFactory.getLogger(XmlSerializerTest.class); @@ -69,14 +60,14 @@ public class XmlSerializerTest { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testWriteToFile() throws IOException, SerializationException { + public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.xml"); - new XmlSerializer().write(file, AASSimple.createEnvironment()); + new XmlSerializer().write(file, AASSimple.ENVIRONMENT); assertTrue(file.exists()); } @Test - public void testSerializeMinimal() throws SerializationException, SAXException { + public void testSerializeMinimal() throws IOException, SerializationException, SAXException { File file = new File("src/test/resources/minimum.xml"); Environment environment = new DefaultEnvironment.Builder() .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() @@ -90,21 +81,21 @@ public void testSerializeMinimal() throws SerializationException, SAXException { } @Test - public void testSerializeSimpleWithTestNamespacePrefix() throws SerializationException, SAXException { + public void testSerializeSimpleWithTestNamespacePrefix() throws IOException, SerializationException, SAXException { Map nsPrefixes = new HashMap<>(AasXmlNamespaceContext.PREFERRED_PREFIX_CONTEXT); nsPrefixes.put("test", nsPrefixes.get("aas")); nsPrefixes.remove("aas"); - validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.createEnvironment(), new XmlSerializer(nsPrefixes)); + validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.ENVIRONMENT, new XmlSerializer(nsPrefixes)); } @Test - public void testSerializeSimple() throws SerializationException, SAXException { - validateXmlSerializer(AASSIMPLE_FILE, AASSimple.createEnvironment()); + public void testSerializeSimple() throws IOException, SerializationException, SAXException { + validateXmlSerializer(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); } @Test - public void testSerializeFull() throws SerializationException, SAXException { - validateXmlSerializer(AASFULL_FILE, AASFull.createEnvironment()); + public void testSerializeFull() throws IOException, SerializationException, SAXException { + validateXmlSerializer(AASFULL_FILE, AASFull.ENVIRONMENT); } @Test @@ -136,14 +127,6 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException assertTrue(errors.isEmpty()); } - @Test - public void testGYear() throws SerializationException, SAXException { - Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); - String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); - Set errors = validateAgainstXsdSchema(xml); - assertTrue(errors.isEmpty()); - } - @Test public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationException, SAXException { @@ -156,7 +139,7 @@ public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationExce @Test public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXException { - ConceptDescription object = AASFull.createEnvironment().getConceptDescriptions().get(0); + ConceptDescription object = AASFull.ENVIRONMENT.getConceptDescriptions().get(0); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().conceptDescriptions(object).build()); Set errors = validateAgainstXsdSchema( xml ); assertTrue(errors.isEmpty()); @@ -164,12 +147,12 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc - private Set validateAgainstXsdSchema(String xml) throws SAXException { + private Set validateAgainstXsdSchema(String xml) throws SerializationException, SAXException { return new XmlSchemaValidator().validateSchema(xml); } private void validateXmlSerializer(File expectedFile, Environment environment) - throws SerializationException, SAXException { + throws IOException, SerializationException, SAXException { validateXmlSerializer(expectedFile, environment, new XmlSerializer()); } @@ -177,61 +160,12 @@ private void validateXmlSerializer(File expectedFile, Environment environment, X throws SerializationException, SAXException { String actual = xmlSerializer.write(environment); Set errors = validateAgainstXsdSchema(actual); - logger.debug(actual); + logger.info(actual); logErrors(expectedFile.getName(), errors); assertTrue(errors.isEmpty()); - CompareMatcher xmlTestMatcher = CompareMatcher - .isSimilarTo(expectedFile) - .normalizeWhitespace() - .ignoreComments() - .withNodeFilter((Predicate) node -> { - return ignoreDefaults(node); - }) // ignore default fields - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes) - ); - MatcherAssert.assertThat(removeDefaults(actual), xmlTestMatcher); - } - - private String removeDefaults(String aasXml) { - aasXml = aasXml.replace("Instance", ""); - aasXml = aasXml.replace("Instance", ""); - aasXml = aasXml.replace("VARIABLE", ""); - aasXml = aasXml.replace("VARIABLE", ""); - aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions - aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions - aasXml = aasXml.replace("ConceptQualifier", ""); - aasXml = aasXml.replace("ConceptQualifier", ""); - aasXml = aasXml.replace("true", ""); - aasXml = aasXml.replace("true", ""); - return aasXml; - } - - private boolean ignoreDefaults(Node node) { - if (node.getLocalName() != null - && node.getLocalName().equals("kind") - && node.getFirstChild().getNodeValue().equals("Instance")) { - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("category") - && node.getFirstChild().getNodeValue().equals("VARIABLE")) { - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("category") - && node.getFirstChild().getNodeValue().equals("PROPERTY")) { // TODO: only for ConceptDescriptions - return false; - } - - if (node.getLocalName() != null - && node.getLocalName().equals("orderRelevant") - && node.getFirstChild().getNodeValue().equals("true")) { - return false; - } - - return true; + CompareMatcher xmlTestMatcher = CompareMatcher.isSimilarTo(expectedFile).normalizeWhitespace().ignoreComments() + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes)); + MatcherAssert.assertThat(actual, xmlTestMatcher); } private void logErrors(String validatedFileName, Set errors) { diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java index eff9fa49c..8cff59e30 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +47,7 @@ public static void prepareValidator() throws SAXException { } @Test - @Parameters({ "src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified.xml", "src/test/resources/test_demo_full_example.xml" }) + @Parameters({"src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml"}) // import from admin-shell.io -> is actually V3 // -> fix name, as soon as it is fixed externally public void validateValidXml(String file) throws IOException { @@ -56,7 +57,7 @@ public void validateValidXml(String file) throws IOException { } @Test - @Parameters({ "src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid.xml" }) + @Parameters({"src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid_V2.0.xml"}) public void validateInvalidXml(String file) throws IOException { Set errors = validateXmlFile(file); logErrors(file, errors); diff --git a/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml b/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml new file mode 100644 index 000000000..08a2e06ce --- /dev/null +++ b/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml @@ -0,0 +1,436 @@ + + + + + ExampleMotor + + http://customer.com/aas/9175_7013_7091_9168 + + + Instance + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + + + + + GlobalReference + + + Submodel + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + GlobalReference + + + Submodel + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + + + + GlobalReference + + + Submodel + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + + + + + Documentation + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + Instance + + + OperatingManual + Instance + + GlobalReference + + + ConceptDescription + http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + + Parameter + DigitalFile_PDF + Instance + + GlobalReference + + + ConceptDescription + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + file:///aasx/OperatingManual.pdf + application/pdf + + + Title + Instance + + GlobalReference + + + ConceptDescription + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + + en + Operating Manual + + + + + + + + + TechnicalData + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + Instance + + GlobalReference + + + ConceptDescription + 0173-1#01-AFZ615#016 + + + + + + Parameter + MaxRotationSpeed + Instance + + GlobalReference + + + ConceptDescription + 0173-1#02-BAA120#008 + + + + xs:int + 5000 + + + + + OperationalData + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + Instance + + + Variable + RotationSpeed + Instance + + GlobalReference + + + ConceptDescription + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + xs:int + 4370 + + + + + + + MaxRotationSpeed + + 2 + 0 + + + 0173-1#02-BAA120#008 + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + max. Drehzahl + + + en + Max. rotation speed + + + + 1/min + + + GlobalReference + + + ConceptDescription + 0173-1#05-AAA650#002 + + + + REAL_MEASURE + + + de + Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf + + + en + Greatest permissible rotation speed with which the motor or feeding unit may be operated + + + + + + + + + + Title + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + de + Titel + + + en + Title + + + + + de + Titel + + + STRING_TRANSLATABLE + + + de + Sprachabhängiger Titel des Dokuments. + + + + + + + + + RotationSpeed + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Aktuelle Drehzahl + + + en + Actual rotation speed + + + + + en + RotationSpeed + + + + 1/min + + + GlobalReference + + + ConceptDescription + 0173-1#05-AAA650#002 + + + + REAL_MEASURE + + + de + Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird + + + en + Actual rotation speed with which the motor or feeding unit is operated + + + + + + + + + Document + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Dokument + + + en + Document + + + + + en + Document + + + + [ISO 15519-1:2010] + + IRI + + + de + Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. + + + + + + + + + DigitalFile + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + GlobalReference + + + ConceptDescription + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas + + + + + + + + de + Digitale Datei + + + + + de + digitale Datei + + + IRI + + + de + Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml b/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml new file mode 100644 index 000000000..d6a6a04dd --- /dev/null +++ b/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml @@ -0,0 +1,470 @@ + + + + + + ExampleMotor + + CONSTANT + + http://customer.com/aas/9175_7013_7091_9168 + + + + + http://customer.com/assets/KHBVZJSQKIY + + + + + + + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + + + + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + + + + + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + + + + + + + + + Documentation + + + CONSTANT + + + http://i40.customer.com/type/1/1/1A7B62B529F19152 + + Instance + + + + + + OperatingManual + + Instance + + + + www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + + + + DigitalFile_PDF + + + PARAMETER + + Instance + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + application/pdf + + + /aasx/OperatingManual.pdf + + + + + + + Title + + Instance + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + + Operating Manual + + + + + + false + false + + + + + + + TechnicalData + + + CONSTANT + + + http://i40.customer.com/type/1/1/7A7104BDAB57E184 + + Instance + + + + 0173-1#01-AFZ615#016 + + + + + + + + MaxRotationSpeed + + + PARAMETER + + Instance + + + + 0173-1#02-BAA120#008 + + + + + integer + + + 5000 + + + + + + + + + OperationalData + + + VARIABLE + + + http://i40.customer.com/instance/1/1/AC69B1CB44F07935 + + + Instance + + + + + + + + RotationSpeed + + + VARIABLE + + Instance + + + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + + + + + + integer + + + 4370 + + + + + + + + + + + MaxRotationSpeed + + PROPERTY + + 0173-1#02-BAA120#008 + + + 2 + 0 + + + + + REAL_MEASURE + + + Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf + + + Greatest permissible rotation speed with which the motor or feeding unit may be operated + + + + + max. Drehzahl + + + Max. rotation speed + + + + + + + + 1/min + + + + + 0173-1#05-AAA650#002 + + + + + + + + + + + + + Title + + PROPERTY + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title + + + + + STRING_TRANSLATABLE + + + Sprachabhängiger Titel des Dokuments. + + + + + Titel + + + Title + + + + + Titel + + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + RotationSpeed + + PROPERTY + + http://customer.com/cd/1/1/18EBD56F6B43D895 + + + + + + REAL_MEASURE + + + Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird + + + Actual rotation speed with which the motor or feeding unit is operated + + + + + Aktuelle Drehzahl + + + Actual rotation speed + + + + + RotationSpeed + + + + + 1/min + + + + + 0173-1#05-AAA650#002 + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + Document + + + COLLECTION + + + + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document + + + + + URL + + + Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. + + + + + Dokument + + + Document + + + + + Document + + + + [ISO 15519-1:2010] + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + + + DigitalFile + + + DOCUMENT + + + http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile + + + + + URL + + + Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. + + + + + Digitale Datei + + + + + digitale Datei + + + + + + + + + + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 + + + + + + + diff --git a/dataformat-xml/src/test/resources/annotated_relationship_example.xml b/dataformat-xml/src/test/resources/annotated_relationship_example.xml index 3573866cb..d2fee638f 100644 --- a/dataformat-xml/src/test/resources/annotated_relationship_example.xml +++ b/dataformat-xml/src/test/resources/annotated_relationship_example.xml @@ -1,11 +1,11 @@ - + TestSubmodel - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance @@ -14,7 +14,7 @@ Parameter ExampleAnnotatedRelationshipElement - ExternalReference + GlobalReference GlobalReference @@ -60,6 +60,7 @@ Parameter ExampleProperty3 + Instance xs:string some example annotation diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index b7b77781f..799effff7 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,5 +1,5 @@ - diff --git a/dataformat-xml/src/test/resources/minimum.xml b/dataformat-xml/src/test/resources/minimum.xml index 12445b81e..705afc014 100644 --- a/dataformat-xml/src/test/resources/minimum.xml +++ b/dataformat-xml/src/test/resources/minimum.xml @@ -1,7 +1,5 @@ - + https://acplt.org/Test_AssetAdministrationShell @@ -10,4 +8,5 @@ - \ No newline at end of file + + diff --git a/dataformat-xml/src/test/resources/operation_example.xml b/dataformat-xml/src/test/resources/operation_example.xml index bbc5798bb..62b9d979c 100644 --- a/dataformat-xml/src/test/resources/operation_example.xml +++ b/dataformat-xml/src/test/resources/operation_example.xml @@ -1,28 +1,28 @@ - + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance - ExternalReference + GlobalReference GlobalReference @@ -35,17 +35,18 @@ Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -60,7 +61,7 @@ Constant ExampleProperty1 - ExternalReference + GlobalReference GlobalReference @@ -71,7 +72,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -88,7 +89,7 @@ Variable ExampleProperty2 - ExternalReference + GlobalReference GlobalReference @@ -99,7 +100,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -118,7 +119,7 @@ Constant ExampleProperty2 - ExternalReference + GlobalReference GlobalReference @@ -129,7 +130,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -148,7 +149,7 @@ Constant ExampleProperty3 - ExternalReference + GlobalReference GlobalReference @@ -159,7 +160,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index 93b4cc661..c7f7131dd 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,5 +1,5 @@ - + TestSubmodel @@ -13,7 +13,7 @@ ManufacturerName - ExternalReference + GlobalReference GlobalReference @@ -36,7 +36,7 @@ xs:string http://acplt.org/ValueId/ACPLT - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 26fbaefe4..3a2ce75a1 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -1,27 +1,15 @@ - + TestAssetAdministrationShell - - - en-us - An Example Asset Administration Shell for the test application - - - de - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - 0 - 9 + 0.9 + 0 https://acplt.org/Test_AssetAdministrationShell - ExternalReference + GlobalReference AssetAdministrationShell @@ -31,11 +19,19 @@ Instance - https://acplt.org/Test_Asset + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset + + + - ExternalReference + GlobalReference Submodel @@ -44,7 +40,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +49,7 @@ - ExternalReference + GlobalReference Submodel @@ -68,11 +64,19 @@ https://acplt.org/Test_AssetAdministrationShell_Mandatory Instance - https://acplt.org/Test_Asset_Mandatory + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Mandatory + + + - ExternalReference + GlobalReference Submodel @@ -81,7 +85,7 @@ - ExternalReference + GlobalReference Submodel @@ -96,33 +100,39 @@ https://acplt.org/Test_AssetAdministrationShell2_Mandatory Instance - https://acplt.org/Test_Asset_Mandatory + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Mandatory + + + TestAssetAdministrationShell - - - en-us - An Example Asset Administration Shell for the test application - - - de - Ein Beispiel-Verwaltungsschale für eine Test-Anwendung - - - 0 - 9 + 0.9 + 0 https://acplt.org/Test_AssetAdministrationShell_Missing Instance - https://acplt.org/Test_Asset_Missing + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset_Missing + + + - ExternalReference + GlobalReference Submodel @@ -137,23 +147,23 @@ Identification - + en-us An example asset identification submodel for the test application - - + + de Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 http://acplt.org/Submodels/Assets/TestAsset/Identification Instance - ExternalReference + GlobalReference Submodel @@ -164,24 +174,18 @@ ManufacturerName - - - en-us - Manufacturer Name - - - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -204,7 +208,7 @@ xs:string http://acplt.org/ValueId/ACPLT - ExternalReference + GlobalReference GlobalReference @@ -214,20 +218,19 @@ - VARIABLE InstanceId - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -235,30 +238,10 @@ - - - ExternalReference - - - GlobalReference - something_random_e14ad770 - - - - - ExternalReference - - - GlobalReference - something_random_bd061acd - - - - xs:string 978-8234-234-342 - ExternalReference + GlobalReference GlobalReference @@ -272,22 +255,22 @@ BillOfMaterial - + en-us An example bill of material submodel for the test application - - + + de Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + - 0 + 0.9 http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial Instance - ExternalReference + GlobalReference Submodel @@ -299,17 +282,17 @@ ExampleEntity - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -319,21 +302,21 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -343,8 +326,8 @@ xs:string http://acplt.org/ValueId/ExampleValue2 - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValue2 @@ -353,21 +336,21 @@ - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -377,8 +360,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -392,17 +375,17 @@ ExampleEntity2 - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - ExternalReference + GlobalReference GlobalReference @@ -411,30 +394,38 @@ SelfManagedEntity - https://acplt.org/Test_Asset2 + + GlobalReference + + + AssetAdministrationShell + https://acplt.org/Test_Asset2 + + + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel Instance - ExternalReference + GlobalReference GlobalReference @@ -444,20 +435,20 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -473,8 +464,8 @@ https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -501,20 +492,20 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -530,8 +521,8 @@ https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -558,28 +549,30 @@ - PARAMETER + Parameter ExampleProperty3 + Instance xs:string some example annotation - PARAMETER + Parameter ExampleOperation + Template - + en-us Example Operation object - - + + de Beispiel Operation Element - + - ExternalReference + GlobalReference GlobalReference @@ -591,20 +584,20 @@ - CONSTANT + Constant ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -615,7 +608,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -631,20 +624,20 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -655,7 +648,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -671,20 +664,20 @@ - CONSTANT + Constant ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -695,7 +688,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -709,60 +702,935 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - ExternalReference + GlobalReference GlobalReference http://acplt.org/Capabilities/ExampleCapability +<<<<<<< HEAD - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - ExternalReference + GlobalReference +======= + + + + + ExampleRelationshipElement + Parameter + + Example RelationshipElement object + Beispiel RelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + ExampleEntity + ExampleProperty2 + + + + + + + ExampleAnnotatedRelationshipElement + Parameter + + Example AnnotatedRelationshipElement object + Beispiel AnnotatedRelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial + ExampleEntity + ExampleProperty2 + + + + + + ExampleProperty3 + Parameter + Instance + some example annotation + string + + + + + + + + ExampleOperation + Parameter + + Example Operation object + Beispiel Operation Element + + Template + + + http://acplt.org/Operations/ExampleOperation + + + + + + ExampleProperty3 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + ExampleProperty1 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + ExampleProperty2 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + + + + ExampleCapability + Parameter + + Example Capability object + Beispiel Capability Element + + + + http://acplt.org/Capabilities/ExampleCapability + + + + + + + ExampleBasicEvent + Parameter + + Example BasicEvent object + Beispiel BasicEvent Element + + + + http://acplt.org/Events/ExampleBasicEvent + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter + + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/ValueId/ExampleValueId + + + http://acplt.org/ValueId/ExampleValueId + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + http://acplt.org/ValueId/ExampleMultiLanguageValueId + + + + Example value of a MultiLanguageProperty element + Beispielswert für ein MulitLanguageProperty-Element + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + + + http://acplt.org/Ranges/ExampleRange + + + 100 + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter + + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + false + false + + + + ExampleBlob + Parameter + + Example Blob object + Beispiel Blob Element + + + + http://acplt.org/Blobs/ExampleBlob + + + AQIDBAU= + application/pdf + + + + + ExampleFile + Parameter + + Example File object + Beispiel File Element + + + + http://acplt.org/Files/ExampleFile + + + /TestFile.pdf + application/pdf + + + + + ExampleReferenceElement + Parameter + + Example Reference Element object + Beispiel Reference Element Element + + + + http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + https://acplt.org/Test_Submodel + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + + + + + Test_Submodel_Mandatory + https://acplt.org/Test_Submodel_Mandatory + Template + + + + ExampleRelationshipElement + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + ExampleAnnotatedRelationshipElement + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + + ExampleOperation + Template + + + + + ExampleCapability + + + + + ExampleBasicEvent + + + https://acplt.org/Test_Submodel_Mandatory + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + true + + + + ExampleProperty + string + + + + + ExampleMultiLanguageProperty + + + + + ExampleRange + int + + + + + + + + ExampleSubmodelCollectionUnordered + false + false + + + + ExampleBlob + application/pdf + + + + + ExampleFile + application/pdf + + + + + ExampleReferenceElement + + + + + + + + ExampleSubmodelCollectionUnordered2 + false + false + + + + + + + Test_Submodel2_Mandatory + https://acplt.org/Test_Submodel2_Mandatory + Instance + + + + TestSubmodel + + An example submodel for the test application + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + 0 + 0.9 + + https://acplt.org/Test_Submodel_Missing + Instance + +>>>>>>> update-to-rc02-smlist-tests GlobalReference http://acplt.org/Events/ExampleBasicEvent +<<<<<<< HEAD - ModelReference + GlobalReference +======= + + + + + ExampleRelationshipElement + Parameter + + Example RelationshipElement object + Beispiel RelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleRelationshipElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + + ExampleAnnotatedRelationshipElement + Parameter + + Example AnnotatedRelationshipElement object + Beispiel AnnotatedRelationshipElement Element + + + + http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleMultiLanguageProperty + + + + + + ExampleProperty + Parameter + Instance + some example annotation + string + + + + + + + + ExampleOperation + Parameter + + Example Operation object + Beispiel Operation Element + + Template + + + http://acplt.org/Operations/ExampleOperation + + + + + + ExampleProperty3 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + ExampleProperty1 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + ExampleProperty2 + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + + + + ExampleCapability + Parameter + + Example Capability object + Beispiel Capability Element + + + + http://acplt.org/Capabilities/ExampleCapability + + + + + + + ExampleBasicEvent + Parameter + + Example BasicEvent object + Beispiel BasicEvent Element + + + + http://acplt.org/Events/ExampleBasicEvent + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter + + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + + + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + + + http://acplt.org/Properties/ExampleProperty + + + + + http://acplt.org/Qualifier/ExampleQualifier + string + + + exampleValue + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + Example value of a MultiLanguageProperty element + Beispielswert für ein MulitLanguageProperty-Element + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + + + http://acplt.org/Ranges/ExampleRange + + + 100 + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter + + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + + + + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + + + false + false + + + + ExampleBlob + Parameter + + Example Blob object + Beispiel Blob Element + + + + http://acplt.org/Blobs/ExampleBlob + + + AQIDBAU= + application/pdf + + + + + ExampleFile + Parameter + + Example File object + Beispiel File Element + + + + http://acplt.org/Files/ExampleFile + + + /TestFile.pdf + application/pdf + + + + + ExampleReferenceElement + Parameter + + Example Reference Element object + Beispiel Reference Element Element + + + + http://acplt.org/ReferenceElements/ExampleReferenceElement + + + + + https://acplt.org/Test_Submodel_Missing + ExampleSubmodelCollectionOrdered + ExampleProperty + + + + + + + + + + + TestSubmodel + + An example submodel for the test application + Ein Beispiel-Teilmodell für eine Test-Anwendung + + + 0 + 0.9 + + https://acplt.org/Test_Submodel_Template + Template + +>>>>>>> update-to-rc02-smlist-tests Submodel https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -770,50 +1638,48 @@ - input - on + Input + On - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example ExampleSubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel ExampleSubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -823,8 +1689,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -833,21 +1699,21 @@ - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -855,18 +1721,18 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ValueId/ExampleMultiLanguageValueId @@ -875,21 +1741,21 @@ - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -901,46 +1767,46 @@ 100 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -951,21 +1817,21 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -976,21 +1842,21 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -998,15 +1864,15 @@ - ExternalReference - + GlobalReference + Submodel https://acplt.org/Test_Submodel - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1034,8 +1900,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1051,8 +1917,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1072,11 +1938,11 @@ SubmodelElementCollection - ExampleSubmodelElementCollection + ExampleSubmodelCollectionOrdered - Blob - ExampleBlob + Property + ExampleProperty @@ -1088,8 +1954,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1100,6 +1966,7 @@ ExampleOperation + Template ExampleCapability @@ -1107,15 +1974,15 @@ ExampleBasicEvent - ModelReference + GlobalReference Submodel https://acplt.org/Test_Submodel_Mandatory - SubmodelElementList - ExampleSubmodelElementListUnordered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1123,13 +1990,11 @@ - output - off + Output + Off - - ExampleSubmodelElementListUnordered - false - SubmodelElement + + ExampleSubmodelCollectionOrdered ExampleProperty @@ -1143,9 +2008,9 @@ xs:int - + - ExampleSubmodelElementCollection + ExampleSubmodelCollectionUnordered ExampleBlob @@ -1161,7 +2026,7 @@ - ExampleSubmodelElementCollection2 + ExampleSubmodelCollectionUnordered2 @@ -1171,25 +2036,25 @@ Instance - TestSubmodelMissing + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel_Missing Instance - ExternalReference + GlobalReference GlobalReference @@ -1199,20 +2064,20 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -1228,8 +2093,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1245,8 +2110,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1256,20 +2121,20 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - ExternalReference + GlobalReference GlobalReference @@ -1285,8 +2150,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1302,8 +2167,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered MultiLanguageProperty @@ -1313,28 +2178,30 @@ - PARAMETER + Parameter ExampleProperty + Instance xs:string some example annotation - PARAMETER + Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1346,20 +2213,20 @@ - CONSTANT + Constant ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1383,20 +2250,20 @@ - CONSTANT + Constant ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1420,20 +2287,20 @@ - CONSTANT + Constant ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference + GlobalReference GlobalReference @@ -1441,6 +2308,7 @@ +<<<<<<< HEAD http://acplt.org/Qualifier/ExampleQualifier @@ -1455,20 +2323,20 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - ExternalReference + GlobalReference GlobalReference @@ -1478,20 +2346,20 @@ - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - ExternalReference + GlobalReference GlobalReference @@ -1500,15 +2368,15 @@ - ExternalReference + GlobalReference Submodel https://acplt.org/Test_Submodel_Missing - SubmodelElementList - ExampleSubmodelElementListOrdered + SubmodelElementCollection + ExampleSubmodelCollectionOrdered Property @@ -1516,50 +2384,48 @@ - input - on + Input + On - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example SubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel SubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -1576,21 +2442,21 @@ exampleValue - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -1598,32 +2464,32 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -1635,46 +2501,46 @@ 100 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -1685,21 +2551,21 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -1710,21 +2576,21 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -1732,7 +2598,7 @@ - ModelReference + GlobalReference Submodel @@ -1740,11 +2606,11 @@ SubmodelElementCollection - ExampleSubmodelElementCollection + ExampleSubmodelCollectionOrdered - File - ExampleFile + Property + ExampleProperty @@ -1754,25 +2620,25 @@ - TestSubmodelTemplate + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_Submodel_Template Template - ExternalReference + GlobalReference GlobalReference @@ -1782,20 +2648,21 @@ - PARAMETER + Parameter ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1806,14 +2673,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1823,14 +2682,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1839,20 +2690,21 @@ - PARAMETER + Parameter ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1863,14 +2715,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1880,14 +2724,6 @@ ModelReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty @@ -1896,20 +2732,21 @@ - PARAMETER + Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -1921,20 +2758,41 @@ - CONSTANT + Constant ExampleProperty +<<<<<<< HEAD +======= + + + ExampleProperty + + + + + + + ExampleSubmodelCollectionOrdered + Parameter - + Example SubmodelElementCollectionOrdered object + Beispiel SubmodelElementCollectionOrdered Element + +>>>>>>> update-to-rc02-smlist-tests +======= + + en-us Example Property object - - + + de Beispiel Property Element - + +>>>>>>> update-to-rc02-xml + Template - ExternalReference + GlobalReference GlobalReference @@ -1942,6 +2800,7 @@ +<<<<<<< HEAD xs:string @@ -1951,20 +2810,108 @@ - CONSTANT + Constant ExampleProperty +<<<<<<< HEAD +======= + true + + + + ExampleProperty + Constant + + Example Property object + Beispiel Property Element + + Template + + + http://acplt.org/Properties/ExampleProperty + + + string + + + + + ExampleMultiLanguageProperty + Constant + + Example MultiLanguageProperty object + Beispiel MulitLanguageProperty Element + + Template + + + http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty + + + + + + + ExampleRange + Parameter + + Example Range object + Beispiel Range Element + + Template + + + http://acplt.org/Ranges/ExampleRange + + + 100 + int + + + + + ExampleRange2 + Parameter + + Example Range object + Beispiel Range Element + + Template + + + http://acplt.org/Ranges/ExampleRange + + + 0 + int + + + + + + + + ExampleSubmodelCollectionUnordered + Parameter - + Example SubmodelElementCollectionUnordered object + Beispiel SubmodelElementCollectionUnordered Element + +>>>>>>> update-to-rc02-smlist-tests +======= + + en-us Example Property object - - + + de Beispiel Property Element - + +>>>>>>> update-to-rc02-xml + Template - ExternalReference + GlobalReference GlobalReference @@ -1981,20 +2928,21 @@ - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2009,20 +2957,21 @@ - PARAMETER + Parameter ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2032,20 +2981,21 @@ - PARAMETER + Parameter ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + + Template - ExternalReference + GlobalReference GlobalReference @@ -2054,66 +3004,58 @@ - ModelReference + GlobalReference - - Submodel - https://acplt.org/Test_Submodel_Template - - - Operation - ExampleOperation - Property ExampleProperty - output - off + Output + Off - - PARAMETER - ExampleSubmodelElementListOrdered + + Parameter + ExampleSubmodelCollectionOrdered - + en-us - Example SubmodelElementListOrdered object - - + Example SubmodelElementCollectionOrdered object + + de - Beispiel SubmodelElementListOrdered Element - + Beispiel SubmodelElementCollectionOrdered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - true - SubmodelElement - CONSTANT + Constant ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -2123,21 +3065,22 @@ xs:string - CONSTANT + Constant ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -2146,21 +3089,22 @@ - PARAMETER + Parameter ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2171,21 +3115,22 @@ 100 - PARAMETER + Parameter ExampleRange2 - + en-us Example Range object - - + + de Beispiel Range Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2196,46 +3141,48 @@ 0 - + - PARAMETER - ExampleSubmodelElementCollection + Parameter + ExampleSubmodelCollectionUnordered - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - PARAMETER + Parameter ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -2245,21 +3192,22 @@ application/pdf - PARAMETER + Parameter ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -2269,21 +3217,22 @@ application/pdf - PARAMETER + Parameter ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + + Template - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -2294,24 +3243,25 @@ - PARAMETER - ExampleSubmodelElementCollection2 + Parameter + ExampleSubmodelCollectionUnordered2 - + en-us - Example SubmodelElementCollection object - - + Example SubmodelElementCollectionUnordered object + + de - Beispiel SubmodelElementCollection Element - + Beispiel SubmodelElementCollectionUnordered Element + + Template - ExternalReference + GlobalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered @@ -2323,27 +3273,27 @@ TestConceptDescription - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_ConceptDescription - ExternalReference + GlobalReference GlobalReference - http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription + http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription @@ -2354,68 +3304,67 @@ https://acplt.org/Test_ConceptDescription_Mandatory - PROPERTY TestConceptDescription1 - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0 - 9 + 0.9 + 0 https://acplt.org/Test_ConceptDescription_Missing TestSpec_01 - 0 - 9 + 0.9 + 0 http://acplt.org/DataSpecifciations/Example/Identification - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de Test Specification - - + + en-us TestSpecification - + - + de Test Spec - - + + en-us TestSpec - + SpaceUnit - ExternalReference - + GlobalReference + GlobalReference http://acplt.org/Units/SpaceUnit @@ -2426,14 +3375,14 @@ SU REAL_MEASURE - + de Dies ist eine Data Specification für Testzwecke - - + + en-us This is a DataSpecification for testing purposes - + string @@ -2441,7 +3390,7 @@ http://acplt.org/ValueId/ExampleValueId - ExternalReference + GlobalReference GlobalReference @@ -2453,7 +3402,7 @@ http://acplt.org/ValueId/ExampleValueId2 - ExternalReference + GlobalReference GlobalReference @@ -2465,13 +3414,14 @@ TEST + Max - ExternalReference + GlobalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index 5e37d5016..a09966209 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -1,20 +1,26 @@ - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - http://customer.com/assets/KHBVZJSQKIY + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - ExternalReference + GlobalReference GlobalReference @@ -27,7 +33,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - ExternalReference + GlobalReference GlobalReference @@ -44,7 +50,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +59,7 @@ - ExternalReference + GlobalReference Submodel @@ -62,7 +68,7 @@ - ExternalReference + GlobalReference Submodel @@ -77,8 +83,9 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance - ExternalReference + GlobalReference GlobalReference @@ -88,10 +95,11 @@ - PARAMETER + Parameter MaxRotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -111,8 +119,9 @@ OperatingManual + Instance - ExternalReference + GlobalReference ConceptDescription @@ -123,8 +132,9 @@ Title + Instance - ExternalReference + GlobalReference ConceptDescription @@ -137,8 +147,9 @@ DigitalFile_PDF + Instance - ExternalReference + GlobalReference ConceptDescription @@ -159,10 +170,11 @@ Instance - VARIABLE + Variable RotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -183,44 +195,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -233,44 +245,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -282,35 +294,35 @@ MaxRotationSpeed 2 - 1 + 2.1 0173-1#02-BAA120#008 - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - ExternalReference + GlobalReference GlobalReference @@ -321,14 +333,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -342,39 +354,39 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActRotationSpeed - + ActualRotationSpeed + 1/min - ExternalReference + GlobalReference GlobalReference @@ -385,14 +397,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -405,40 +417,40 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2db066ec3..2cb861291 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -1,20 +1,25 @@ - - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - http://customer.com/assets/KHBVZJSQKIY + + GlobalReference + + + AssetAdministrationShell + http://customer.com/assets/KHBVZJSQKIY + + + EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - ExternalReference + GlobalReference GlobalReference @@ -27,7 +32,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - ExternalReference + GlobalReference GlobalReference @@ -44,7 +49,7 @@ - ExternalReference + GlobalReference Submodel @@ -53,7 +58,7 @@ - ExternalReference + GlobalReference Submodel @@ -62,7 +67,7 @@ - ExternalReference + GlobalReference Submodel @@ -77,8 +82,9 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance - ExternalReference + GlobalReference GlobalReference @@ -88,10 +94,11 @@ - PARAMETER + Parameter MaxRotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -111,8 +118,9 @@ OperatingManual + Instance - ExternalReference + GlobalReference ConceptDescription @@ -123,8 +131,9 @@ Title + Instance - ExternalReference + GlobalReference ConceptDescription @@ -137,8 +146,9 @@ DigitalFile_PDF + Instance - ExternalReference + GlobalReference ConceptDescription @@ -159,10 +169,11 @@ Instance - VARIABLE + Variable RotationSpeed + Instance - ExternalReference + GlobalReference ConceptDescription @@ -183,44 +194,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -233,44 +244,44 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -282,35 +293,35 @@ MaxRotationSpeed 2 - 1 + 2.1 0173-1#02-BAA120#008 - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - ExternalReference + GlobalReference GlobalReference @@ -321,14 +332,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -342,39 +353,39 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActRotationSpeed - + ActualRotationSpeed + 1/min - ExternalReference + GlobalReference GlobalReference @@ -385,14 +396,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -405,40 +416,40 @@ - ExternalReference + GlobalReference GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + From 7e1b1c43da7dfacffbdc269f21e38536dabee71e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 29 Jun 2023 16:55:45 +0200 Subject: [PATCH 08/91] Update model project --- model/pom.xml | 2 + .../aas4j/v3/model/AasSubmodelElements.java | 38 +-- .../v3/model/AdministrativeInformation.java | 66 +--- .../model/AnnotatedRelationshipElement.java | 10 +- .../v3/model/AssetAdministrationShell.java | 48 +-- .../AssetAdministrationShellDescriptor.java | 169 ++++++++++ .../aas4j/v3/model/AssetInformation.java | 87 ++---- .../digitaltwin/aas4j/v3/model/AssetKind.java | 19 +- .../aas4j/v3/model/BasicEventElement.java | 140 ++++----- .../digitaltwin/aas4j/v3/model/Blob.java | 40 +-- .../aas4j/v3/model/ConceptDescription.java | 18 +- .../v3/model/DataSpecificationContent.java | 7 +- .../v3/model/DataSpecificationIec61360.java | 220 ++++++------- .../model/DataSpecificationPhysicalUnit.java | 293 ++++++++++++++++++ .../aas4j/v3/model/DataTypeDefXsd.java | 194 ++++++++++++ .../aas4j/v3/model/DataTypeIec61360.java | 46 +-- .../aas4j/v3/model/Descriptor.java | 49 +++ .../digitaltwin/aas4j/v3/model/Direction.java | 8 +- .../v3/model/EmbeddedDataSpecification.java | 18 +- .../digitaltwin/aas4j/v3/model/Endpoint.java | 61 ++++ .../digitaltwin/aas4j/v3/model/Entity.java | 78 ++--- .../aas4j/v3/model/EntityType.java | 8 +- .../aas4j/v3/model/Environment.java | 46 +-- .../aas4j/v3/model/EventPayload.java | 132 ++++---- .../digitaltwin/aas4j/v3/model/Extension.java | 55 ++-- .../digitaltwin/aas4j/v3/model/File.java | 40 +-- .../aas4j/v3/model/HasDataSpecification.java | 12 +- .../aas4j/v3/model/HasExtensions.java | 10 +- .../digitaltwin/aas4j/v3/model/HasKind.java | 17 +- .../aas4j/v3/model/HasSemantics.java | 16 +- .../aas4j/v3/model/Identifiable.java | 16 +- .../aas4j/v3/model/annotations/IRI.java | 4 +- .../v3/model/annotations/KnownSubtypes.java | 4 +- .../v3/model/builder/AbstractBuilder.java | 4 +- .../AdministrativeInformationBuilder.java | 37 +-- .../AnnotatedRelationshipElementBuilder.java | 76 ++--- .../AssetAdministrationShellBuilder.java | 85 ++--- ...tAdministrationShellDescriptorBuilder.java | 134 ++++++++ .../builder/AssetInformationBuilder.java | 44 +-- .../builder/BasicEventElementBuilder.java | 168 +++++----- .../aas4j/v3/model/builder/BlobBuilder.java | 126 ++++---- .../aas4j/v3/model/builder/Builder.java | 4 +- .../v3/model/builder/CapabilityBuilder.java | 106 ++++--- .../builder/ConceptDescriptionBuilder.java | 81 ++--- .../DataSpecificationIec61360Builder.java | 140 ++++----- .../DataSpecificationPhysicalUnitBuilder.java | 181 +++++++++++ .../v3/model/builder/DescriptorBuilder.java | 46 +++ .../EmbeddedDataSpecificationBuilder.java | 4 +- .../v3/model/builder/EndpointBuilder.java | 46 +++ .../aas4j/v3/model/builder/EntityBuilder.java | 161 +++++----- .../v3/model/builder/EnvironmentBuilder.java | 44 +-- .../v3/model/builder/EventPayloadBuilder.java | 64 ++-- .../v3/model/builder/ExtensionBuilder.java | 35 +-- .../aas4j/v3/model/builder/FileBuilder.java | 126 ++++---- .../v3/model/builder/LangStringBuilder.java | 54 ++++ .../builder/MultiLanguagePropertyBuilder.java | 124 +++++--- .../v3/model/builder/OperationBuilder.java | 150 +++++---- .../v3/model/builder/PropertyBuilder.java | 128 ++++---- .../builder/ProtocolInformationBuilder.java | 88 ++++++ .../v3/model/builder/QualifierBuilder.java | 26 +- .../aas4j/v3/model/builder/RangeBuilder.java | 126 ++++---- .../v3/model/builder/ReferenceBuilder.java | 44 +-- .../builder/ReferenceElementBuilder.java | 106 ++++--- .../builder/RelationshipElementBuilder.java | 106 ++++--- .../v3/model/builder/ResourceBuilder.java | 24 +- .../model/builder/SpecificAssetIdBuilder.java | 92 ++++++ .../v3/model/builder/SubmodelBuilder.java | 145 +++++---- .../builder/SubmodelDescriptorBuilder.java | 116 +++++++ .../SubmodelElementCollectionBuilder.java | 123 +++++--- .../builder/SubmodelElementListBuilder.java | 136 ++++---- .../DefaultAdministrativeInformation.java | 71 +---- .../DefaultAnnotatedRelationshipElement.java | 119 ++++--- .../impl/DefaultAssetAdministrationShell.java | 114 +++---- ...ultAssetAdministrationShellDescriptor.java | 201 ++++++++++++ .../model/impl/DefaultAssetInformation.java | 81 ++--- .../model/impl/DefaultBasicEventElement.java | 213 +++++++------ 76 files changed, 3997 insertions(+), 2073 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java diff --git a/model/pom.xml b/model/pom.xml index 52cc610de..63f72fda8 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -21,7 +21,9 @@ 1.8 1.5.0 3.5.0 + 4.1 3.4.5 + 0xDFCC34A6 diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index b5216b2d5..897fab65f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,87 +28,87 @@ public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index 19390fc5c..fc1808716 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,80 +29,42 @@ }) public interface AdministrativeInformation extends HasDataSpecification { - /** - * Version of the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version - * - * @return Returns the String for the property version. - */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") - String getVersion(); - - /** - * Version of the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version - * - * @param version desired value for the property version. - */ - void setVersion(String version); - /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision * * @return Returns the String for the property revision. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") String getRevision(); /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision * * @param revision desired value for the property revision. */ void setRevision(String revision); /** - * The subject ID of the subject responsible for making the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator - * - * @return Returns the Reference for the property creator. - */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - Reference getCreator(); - - /** - * The subject ID of the subject responsible for making the element. - * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator - * - * @param creator desired value for the property creator. - */ - void setCreator(Reference creator); - - /** - * Identifier of the template that guided the creation of the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version * - * @return Returns the String for the property templateId. + * @return Returns the String for the property version. */ - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") - String getTemplateId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + String getVersion(); /** - * Identifier of the template that guided the creation of the element. + * Version of the element. * - * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version * - * @param templateId desired value for the property templateId. + * @param version desired value for the property version. */ - void setTemplateId(String templateId); + void setVersion(String version); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index 788534fba..b99fa839e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,18 +35,20 @@ public interface AnnotatedRelationshipElement extends RelationshipElement { * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations + * More information under + * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations * * @return Returns the List of DataElements for the property annotations. */ - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") List getAnnotations(); /** * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations + * More information under + * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations * * @param annotations desired value for the property annotations. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 3e0b0b9cb..05483cef1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,57 +31,59 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under + * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom + * More information under + * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels * * @return Returns the List of References for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") List getSubmodels(); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels * * @param submodels desired value for the property submodels. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..124298da8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; + +import java.util.List; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAssetAdministrationShellDescriptor.class) +}) +public interface AssetAdministrationShellDescriptor extends Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * + * @return Returns the LangStringSet for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * + * @return Returns the LangStringSet for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * + * @param displayName desired value for the property displayName. + */ + void setDisplayName(List displayName); + + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") + Reference getGlobalAssetId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * + * @param globalAssetId desired value for the property globalAssetId. + */ + void setGlobalAssetId(Reference globalAssetId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @return Returns the String for the property identification. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + String getIdentification(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @param identification desired value for the property identification. + */ + void setIdentification(String identification); + + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetId + * + * @return Returns the String for the property specificAssetId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") + SpecificAssetId getSpecificAssetIds(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds + * + * @param specificAssetIds desired value for the property specificAssetIds. + */ + void setSpecificAssetIds(SpecificAssetId specificAssetIds); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * + * @return Returns the String for the property submodelDescriptor. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") + List getSubmodelDescriptor(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * + * @param submodelDescriptor desired value for the property submodelDescriptor. + */ + void setSubmodelDescriptor(List submodelDescriptor); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index ae48cae15..689bb3568 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,100 +34,79 @@ public interface AssetInformation { /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind * * @return Returns the AssetKind for the property assetKind. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") AssetKind getAssetKind(); /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind * * @param assetKind desired value for the property assetKind. */ void setAssetKind(AssetKind assetKind); + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail + * + * @return Returns the Resource for the property defaultThumbnail. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail + * + * @param defaultThumbnail desired value for the property defaultThumbnail. + */ + void setDefaultThumbnail(Resource defaultThumbnail); + /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId * - * @return Returns the String for the property globalAssetId. + * @return Returns the Reference for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") - String getGlobalAssetId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + Reference getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(String globalAssetId); + void setGlobalAssetId(Reference globalAssetId); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds * * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") List getSpecificAssetIds(); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds * * @param specificAssetIds desired value for the property specificAssetIds. */ void setSpecificAssetIds(List specificAssetIds); - /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetId'. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType - * - * @return Returns the String for the property assetType. - */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - String getAssetType(); - - /** - * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset - * under consideration as identified by 'globalAssetId'. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType - * - * @param assetType desired value for the property assetType. - */ - void setAssetType(String assetType); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail - * - * @return Returns the Resource for the property defaultThumbnail. - */ - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail - * - * @param defaultThumbnail desired value for the property defaultThumbnail. - */ - void setDefaultThumbnail(Resource defaultThumbnail); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index 74400ccd9..a781efe26 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,21 +27,16 @@ public enum AssetKind { /** - * Instance asset + * concrete, clearly identifiable component of a certain type */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance") INSTANCE, /** - * Neither a type asset nor an instance asset - */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/NotApplicable") - NOT_APPLICABLE, - - /** - * Type asset + * hardware or software element which specifies the common attributes shared by all instances of the + * type */ - @IRI("https://admin-shell.io/aas/3/0/AssetKind/Type") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Type") TYPE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 1dc3622d9..9393d184c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,96 +29,73 @@ }) public interface BasicEventElement extends EventElement { - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction * * @return Returns the Direction for the property direction. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") Direction getDirection(); /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction * * @param direction desired value for the property direction. */ void setDirection(Direction direction); /** - * State of event. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * State of event. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate * - * @param state desired value for the property state. + * @param lastUpdate desired value for the property lastUpdate. */ - void setState(StateOfEvent state); + void setLastUpdate(String lastUpdate); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval * - * @param messageTopic desired value for the property messageTopic. + * @param maxInterval desired value for the property maxInterval. */ - void setMessageTopic(String messageTopic); + void setMaxInterval(String maxInterval); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker * * @return Returns the Reference for the property messageBroker. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") Reference getMessageBroker(); /** @@ -126,69 +103,92 @@ public interface BasicEventElement extends EventElement { * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker * * @param messageBroker desired value for the property messageBroker. */ void setMessageBroker(Reference messageBroker); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic * - * @return Returns the String for the property lastUpdate. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic * - * @param lastUpdate desired value for the property lastUpdate. + * @param messageTopic desired value for the property messageTopic. */ - void setLastUpdate(String lastUpdate); + void setMessageTopic(String messageTopic); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval * * @return Returns the String for the property minInterval. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") String getMinInterval(); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval * * @param minInterval desired value for the property minInterval. */ void setMinInterval(String minInterval); /** - * For input direction: not applicable. + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed * - * @return Returns the String for the property maxInterval. + * @return Returns the Reference for the property observed. */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + Reference getObserved(); /** - * For input direction: not applicable. + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. * - * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed * - * @param maxInterval desired value for the property maxInterval. + * @param observed desired value for the property observed. */ - void setMaxInterval(String maxInterval); + void setObserved(Reference observed); + + /** + * State of event. + * + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * + * @return Returns the StateOfEvent for the property state. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + StateOfEvent getState(); + + /** + * State of event. + * + * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * + * @param state desired value for the property state. + */ + void setState(StateOfEvent state); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 4d0e69a95..597dfcb1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Blob extends DataElement { /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/Blob/value + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index f9837b1c0..483e61428 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,20 +34,20 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf * - * @return Returns the List of References for the property isCaseOfs. + * @return Returns the List of References for the property isCaseOf. */ - @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - List getIsCaseOfs(); + @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + List getIsCaseOf(); /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf * - * @param isCaseOfs desired value for the property isCaseOfs. + * @param isCaseOf desired value for the property isCaseOf. */ - void setIsCaseOfs(List isCaseOfs); + void setIsCaseOf(List isCaseOf); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 5c99e7daf..2bb5a92e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,7 +26,8 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DataSpecificationIEC61360.class), + @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 48278c09a..1848854db 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; import java.util.List; @@ -27,102 +27,123 @@ * lists conformant to IEC 61360. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DefaultDataSpecificationIEC61360.class) }) -public interface DataSpecificationIec61360 extends DataSpecificationContent { +public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** - * Preferred name + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType * - * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredNames. + * @return Returns the DataTypeIEC61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") - List getPreferredNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + DataTypeIEC61360 getDataType(); /** - * Preferred name + * Data Type * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType * - * @param preferredNames desired value for the property preferredNames. + * @param dataType desired value for the property dataType. */ - void setPreferredNames(List preferredNames); + void setDataType(DataTypeIEC61360 dataType); /** - * Short name + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition * - * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortNames. + * @return Returns the List of LangStrings for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") - List getShortNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + List getDefinition(); /** - * Short name + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition * - * @param shortNames desired value for the property shortNames. + * @param definition desired value for the property definition. */ - void setShortNames(List shortNames); + void setDefinition(List definition); /** - * Unit + * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType * - * @return Returns the String for the property unit. + * @return Returns the LevelType for the property levelType. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") - String getUnit(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + LevelType getLevelType(); /** - * Unit + * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType * - * @param unit desired value for the property unit. + * @param levelType desired value for the property levelType. */ - void setUnit(String unit); + void setLevelType(LevelType levelType); /** - * Unique unit id + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName * - * @return Returns the Reference for the property unitId. + * @return Returns the List of LangStrings for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") - Reference getUnitId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + List getPreferredName(); /** - * Unique unit id + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName * - * @param unitId desired value for the property unitId. + * @param preferredName desired value for the property preferredName. */ - void setUnitId(Reference unitId); + void setPreferredName(List preferredName); + + /** + * Short name + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * + * @return Returns the List of LangStrings for the property shortName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + List getShortName(); + + /** + * Short name + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * + * @param shortName desired value for the property shortName. + */ + void setShortName(List shortName); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -131,74 +152,93 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol * * @param symbol desired value for the property symbol. */ void setSymbol(String symbol); /** - * Data Type + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit * - * @return Returns the DataTypeIec61360 for the property dataType. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") - DataTypeIec61360 getDataType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + String getUnit(); /** - * Data Type + * Unit * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit * - * @param dataType desired value for the property dataType. + * @param unit desired value for the property unit. */ - void setDataType(DataTypeIec61360 dataType); + void setUnit(String unit); /** - * Definition in different languages + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId * - * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definitions. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") - List getDefinitions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + Reference getUnitId(); /** - * Definition in different languages + * Unique unit id + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * + * @param unitId desired value for the property unitId. + */ + void setUnitId(Reference unitId); + + /** + * Value * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value * - * @param definitions desired value for the property definitions. + * @return Returns the String for the property value. */ - void setDefinitions(List definitions); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -207,58 +247,20 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList * * @param valueList desired value for the property valueList. */ void setValueList(ValueList valueList); - /** - * Value - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") - String getValue(); - - /** - * Value - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - - /** - * Set of levels. - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType - * - * @return Returns the LevelType for the property levelType. - */ - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") - LevelType getLevelType(); - - /** - * Set of levels. - * - * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType - * - * @param levelType desired value for the property levelType. - */ - void setLevelType(LevelType levelType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..dc48bc871 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) +}) +public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { + + /** + * Conversion factor + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor + * + * @return Returns the String for the property conversionFactor. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + String getConversionFactor(); + + /** + * Conversion factor + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor + * + * @param conversionFactor desired value for the property conversionFactor. + */ + void setConversionFactor(String conversionFactor); + + /** + * Definition in different languages + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition + * + * @return Returns the List of LangStrings for the property definition. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") + List getDefinition(); + + /** + * Definition in different languages + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition + * + * @param definition desired value for the property definition. + */ + void setDefinition(List definition); + + /** + * Notation of physical unit conformant to DIN + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation + * + * @return Returns the String for the property dinNotation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + String getDinNotation(); + + /** + * Notation of physical unit conformant to DIN + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation + * + * @param dinNotation desired value for the property dinNotation. + */ + void setDinNotation(String dinNotation); + + /** + * Code of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode + * + * @return Returns the String for the property eceCode. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + String getEceCode(); + + /** + * Code of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode + * + * @param eceCode desired value for the property eceCode. + */ + void setEceCode(String eceCode); + + /** + * Name of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName + * + * @return Returns the String for the property eceName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + String getEceName(); + + /** + * Name of physical unit conformant to ECE + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName + * + * @param eceName desired value for the property eceName. + */ + void setEceName(String eceName); + + /** + * Name of NIST physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName + * + * @return Returns the String for the property nistName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + String getNistName(); + + /** + * Name of NIST physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName + * + * @param nistName desired value for the property nistName. + */ + void setNistName(String nistName); + + /** + * Registration authority ID + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId + * + * @return Returns the String for the property registrationAuthorityId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + String getRegistrationAuthorityId(); + + /** + * Registration authority ID + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId + * + * @param registrationAuthorityId desired value for the property registrationAuthorityId. + */ + void setRegistrationAuthorityId(String registrationAuthorityId); + + /** + * Name of SI physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName + * + * @return Returns the String for the property siName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") + String getSiName(); + + /** + * Name of SI physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName + * + * @param siName desired value for the property siName. + */ + void setSiName(String siName); + + /** + * Notation of SI physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation + * + * @return Returns the String for the property siNotation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + String getSiNotation(); + + /** + * Notation of SI physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation + * + * @param siNotation desired value for the property siNotation. + */ + void setSiNotation(String siNotation); + + /** + * Source of definition + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition + * + * @return Returns the String for the property sourceOfDefinition. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") + String getSourceOfDefinition(); + + /** + * Source of definition + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition + * + * @param sourceOfDefinition desired value for the property sourceOfDefinition. + */ + void setSourceOfDefinition(String sourceOfDefinition); + + /** + * Supplier + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier + * + * @return Returns the String for the property supplier. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + String getSupplier(); + + /** + * Supplier + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier + * + * @param supplier desired value for the property supplier. + */ + void setSupplier(String supplier); + + /** + * Name of the physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName + * + * @return Returns the String for the property unitName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + String getUnitName(); + + /** + * Name of the physical unit + * + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName + * + * @param unitName desired value for the property unitName. + */ + void setUnitName(String unitName); + + /** + * Symbol for the physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol + * + * @return Returns the String for the property unitSymbol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + String getUnitSymbol(); + + /** + * Symbol for the physical unit + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol + * + * @param unitSymbol desired value for the property unitSymbol. + */ + void setUnitSymbol(String unitSymbol); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java new file mode 100644 index 000000000..0b375631d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + + +/** + * Enumeration listing all xsd anySimpleTypes + */ +@IRI("aas:DataTypeDefXsd") +public enum DataTypeDefXsd { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/AnyUri") + ANY_URI, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Base64Binary") + BASE64BINARY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Boolean") + BOOLEAN, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Byte") + BYTE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Date") + DATE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTime") + DATE_TIME, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTimeStamp") + DATE_TIME_STAMP, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DayTimeDuration") + DAY_TIME_DURATION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Decimal") + DECIMAL, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Double") + DOUBLE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Duration") + DURATION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Float") + FLOAT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GDay") + GDAY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonth") + GMONTH, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonthDay") + GMONTH_DAY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYear") + GYEAR, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYearMonth") + GYEAR_MONTH, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/HexBinary") + HEX_BINARY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Int") + INT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Integer") + INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Long") + LONG, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NegativeInteger") + NEGATIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonNegativeInteger") + NON_NEGATIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonPositiveInteger") + NON_POSITIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/PositiveInteger") + POSITIVE_INTEGER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Short") + SHORT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/String") + STRING, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Time") + TIME, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedByte") + UNSIGNED_BYTE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedInt") + UNSIGNED_INT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedLong") + UNSIGNED_LONG, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedShort") + UNSIGNED_SHORT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/YearMonthDuration") + YEAR_MONTH_DURATION; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index 91e2768a5..b78e2c83a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIec61360") -public enum DataTypeIec61360 { +@IRI("aas:DataTypeIEC61360") +public enum DataTypeIEC61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java new file mode 100644 index 000000000..a06e883fc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDescriptor; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDescriptor.class), + @KnownSubtypes.Type(value = SubmodelDescriptor.class) +}) +public interface Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * + * @return Returns the List of Endpoints for the property endpoints. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + List getEndpoints(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * + * @param endpoints desired value for the property endpoints. + */ + void setEndpoints(List endpoints); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 471cd52f5..0f510b76a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum Direction { /** * Input direction. */ - @IRI("https://admin-shell.io/aas/3/0/Direction/Input") + @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Input") INPUT, /** * Output direction */ - @IRI("https://admin-shell.io/aas/3/0/Direction/Output") + @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Output") OUTPUT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index a698dd362..67673ab64 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,19 @@ public interface EmbeddedDataSpecification { /** * Reference to the data specification * - * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification + * More information under + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification * * @return Returns the Reference for the property dataSpecification. */ - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") Reference getDataSpecification(); /** * Reference to the data specification * - * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification + * More information under + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification * * @param dataSpecification desired value for the property dataSpecification. */ @@ -52,18 +54,18 @@ public interface EmbeddedDataSpecification { * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent * * @return Returns the DataSpecificationContent for the property dataSpecificationContent. */ - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") DataSpecificationContent getDataSpecificationContent(); /** * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent * * @param dataSpecificationContent desired value for the property dataSpecificationContent. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java new file mode 100644 index 000000000..fa8b8fee6 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; + +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultEndpoint.class) +}) +public interface Endpoint { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * + * @return Returns the String for the property interface. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/interface") + String getInterface(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * + * @param interfaceValue desired value for the property interface. + */ + void setInterface(String interfaceValue); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * + * @return Returns the ProtocolInformation for the property protocolInformation. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + ProtocolInformation getProtocolInformation(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * + * @param protocolInformation desired value for the property protocolInformation. + */ + void setProtocolInformation(ProtocolInformation protocolInformation); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 5ac6854f6..422cdb746 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,20 @@ }) public interface Entity extends SubmodelElement { - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); - /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType * * @return Returns the EntityType for the property entityType. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") EntityType getEntityType(); /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType * * @param entityType desired value for the property entityType. */ @@ -73,41 +52,62 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId * - * @return Returns the String for the property globalAssetId. + * @return Returns the Reference for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") - String getGlobalAssetId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + Reference getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(String globalAssetId); + void setGlobalAssetId(Reference globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId * - * @return Returns the List of SpecificAssetIds for the property specificAssetIds. + * @return Returns the SpecificAssetId for the property specificAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - List getSpecificAssetIds(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + SpecificAssetId getSpecificAssetId(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId * - * @param specificAssetIds desired value for the property specificAssetIds. + * @param specificAssetId desired value for the property specificAssetId. */ - void setSpecificAssetIds(List specificAssetIds); + void setSpecificAssetId(SpecificAssetId specificAssetId); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 875c8dfb4..137e66dde 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,14 +30,14 @@ public enum EntityType { * For co-managed entities there is no separate AAS. Co-managed entities need to be part of a * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/EntityType/CoManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/CoManagedEntity") CO_MANAGED_ENTITY, /** * Self-Managed Entities have their own AAS but can be part of the bill of material of a composite * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/EntityType/SelfManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/SelfManagedEntity") SELF_MANAGED_ENTITY; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 92d8c964e..5ea7ac571 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,58 @@ public interface Environment { /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells * * @return Returns the List of AssetAdministrationShells for the property assetAdministrationShells. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") List getAssetAdministrationShells(); /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells * * @param assetAdministrationShells desired value for the property assetAdministrationShells. */ void setAssetAdministrationShells(List assetAdministrationShells); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index 3e99c1c30..ab5677f03 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,118 +30,116 @@ public interface EventPayload { /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") + Reference getObservableReference(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference * - * @param source desired value for the property source. + * @param observableReference desired value for the property observableReference. */ - void setSource(Reference source); + void setObservableReference(Reference observableReference); /** - * 'semanticId' of the source event element, if available + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId * - * @return Returns the Reference for the property sourceSemanticId. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") - Reference getSourceSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * 'semanticId' of the source event element, if available + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId * - * @param sourceSemanticId desired value for the property sourceSemanticId. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSourceSemanticId(Reference sourceSemanticId); + void setObservableSemanticId(Reference observableSemanticId); /** - * Reference to the referable, which defines the scope of the event. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload * - * @return Returns the Reference for the property observableReference. + * @return Returns the String for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") + String getPayload(); /** - * Reference to the referable, which defines the scope of the event. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload * - * @param observableReference desired value for the property observableReference. + * @param payload desired value for the property payload. */ - void setObservableReference(Reference observableReference); + void setPayload(String payload); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source * - * @return Returns the Reference for the property observableSemanticId. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") - Reference getObservableSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") + Reference getSource(); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source * - * @param observableSemanticId desired value for the property observableSemanticId. + * @param source desired value for the property source. */ - void setObservableSemanticId(Reference observableSemanticId); + void setSource(Reference source); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId * - * @return Returns the String for the property topic. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId * - * @param topic desired value for the property topic. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setTopic(String topic); + void setSourceSemanticId(Reference sourceSemanticId); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId * * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId * * @param subjectId desired value for the property subjectId. */ @@ -150,39 +148,41 @@ public interface EventPayload { /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp * * @return Returns the String for the property timeStamp. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") String getTimeStamp(); /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp * * @param timeStamp desired value for the property timeStamp. */ void setTimeStamp(String timeStamp); /** - * Event specific payload. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic * - * @return Returns the byte[] for the property payload. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - byte[] getPayload(); + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") + String getTopic(); /** - * Event specific payload. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic * - * @param payload desired value for the property payload. + * @param topic desired value for the property topic. */ - void setPayload(byte[] payload); + void setTopic(String topic); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index 07f6b1eec..e8a30fcda 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,12 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; -import java.util.List; - /** * Single extension of an element. @@ -33,77 +32,77 @@ public interface Extension extends HasSemantics { /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/name + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") String getName(); /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/name + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name * * @param name desired value for the property name. */ void setName(String name); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the Reference for the property refersTo. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + Reference getRefersTo(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTo desired value for the property refersTo. */ - void setValueType(DataTypeDefXsd valueType); + void setRefersTo(Reference refersTo); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/Extension/value + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") String getValue(); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/Extension/value + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value * * @param value desired value for the property value. */ void setValue(String value); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType * - * @return Returns the List of References for the property refersTos. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - List getRefersTos(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType * - * @param refersTos desired value for the property refersTos. + * @param valueType desired value for the property valueType. */ - void setRefersTos(List refersTos); + void setValueType(DataTypeDefXsd valueType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index 0640b0862..b4a55cd82 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,41 @@ public interface File extends DataElement { /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/File/value + * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/File/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index 511c51ce5..e4c2c5f05 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { @@ -37,19 +37,19 @@ public interface HasDataSpecification { * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications * * @return Returns the List of EmbeddedDataSpecifications for the property * embeddedDataSpecifications. */ - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") List getEmbeddedDataSpecifications(); /** * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications * * @param embeddedDataSpecifications desired value for the property embeddedDataSpecifications. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 624ff047b..13fb36c83 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface HasExtensions { /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions * * @return Returns the List of Extensions for the property extensions. */ - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") List getExtensions(); /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions * * @param extensions desired value for the property extensions. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 9a4bb07ca..442566120 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,6 +25,7 @@ * An element with a kind is an element that can either represent a template or an instance. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasKind { @@ -32,20 +33,20 @@ public interface HasKind { /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind * - * @return Returns the ModellingKind for the property kind. + * @return Returns the ModelingKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") - ModellingKind getKind(); + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + ModelingKind getKind(); /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind * * @param kind desired value for the property kind. */ - void setKind(ModellingKind kind); + void setKind(ModelingKind kind); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 12e336f11..b3ad0078e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,18 +37,18 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId * * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId * * @param semanticId desired value for the property semanticId. */ @@ -58,18 +58,18 @@ public interface HasSemantics { * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds * * @return Returns the List of References for the property supplementalSemanticIds. */ - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") List getSupplementalSemanticIds(); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds * * @param supplementalSemanticIds desired value for the property supplementalSemanticIds. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index 0f328c7d1..f48661fd5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface Identifiable extends Referable { /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") AdministrativeInformation getAdministration(); /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration * * @param administration desired value for the property administration. */ @@ -53,17 +53,17 @@ public interface Identifiable extends Referable { /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id * * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") String getId(); /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id * * @param id desired value for the property id. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index 3a6ada117..f37653283 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index b7e0c47c4..bf9106f86 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 519f45bdb..38e364da1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index 88fefd0bc..fc362a1a3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; @@ -25,17 +24,6 @@ public abstract class AdministrativeInformationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for version - * - * @param version desired value to be set - * @return Builder object with new value for version - */ - public B version(String version) { - getBuildingInstance().setVersion(version); - return getSelf(); - } - /** * This function allows setting a value for revision * @@ -48,24 +36,13 @@ public B revision(String revision) { } /** - * This function allows setting a value for creator - * - * @param creator desired value to be set - * @return Builder object with new value for creator - */ - public B creator(Reference creator) { - getBuildingInstance().setCreator(creator); - return getSelf(); - } - - /** - * This function allows setting a value for templateId + * This function allows setting a value for version * - * @param templateId desired value to be set - * @return Builder object with new value for templateId + * @param version desired value to be set + * @return Builder object with new value for version */ - public B templateId(String templateId) { - getBuildingInstance().setTemplateId(templateId); + public B version(String version) { + getBuildingInstance().setVersion(version); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 6dd02e7d3..ce53cdd63 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,9 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; + + public abstract class AnnotatedRelationshipElementBuilder> extends ExtendableBuilder { @@ -67,25 +70,37 @@ public B second(Reference second) { return getSelf(); } + /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added * @return Builder object with new value for embeddedDataSpecifications */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); return getSelf(); } /** * This function allows adding a value to the List embeddedDataSpecifications - * + * * @param embeddedDataSpecifications desired value to be added * @return Builder object with new value for embeddedDataSpecifications */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } @@ -167,46 +182,35 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for displayNames - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames - */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for description * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param description desired value to be set + * @return Builder object with new value for description */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for checksum * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 2015b9c28..4bd31ea8d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } @@ -123,57 +123,68 @@ public B category(String category) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for checksum * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows setting a value for description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be set + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List description * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows adding a value to the List displayName * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java new file mode 100644 index 000000000..2a4ba9612 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; + +import java.util.List; + +public abstract class AssetAdministrationShellDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param description desired value to be set + * @return Builder object with new value for description + */ + public B description(List description) { + getBuildingInstance().setDescription(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayName desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for identification + * + * @param identification desired value to be set + * @return Builder object with new value for identification + */ + public B identification(String identification) { + getBuildingInstance().setIdentification(identification); + return getSelf(); + } + + /** + * This function allows setting a value for specificAssetId + * + * @param specificAssetId desired value to be set + * @return Builder object with new value for specificAssetId + */ + public B specificAssetId(SpecificAssetId specificAssetId) { + getBuildingInstance().setSpecificAssetIds(specificAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for globalAssetId + * + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId + */ + public B globalAssetId(Reference globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for submodelDescriptor + * + * @param submodelDescriptor desired value to be set + * @return Builder object with new value for submodelDescriptor + */ + public B submodelDescriptor(List submodelDescriptor) { + getBuildingInstance().setSubmodelDescriptor(submodelDescriptor); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 3794191d6..8ef76deb5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,10 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; @@ -37,13 +34,24 @@ public B assetKind(AssetKind assetKind) { return getSelf(); } + /** + * This function allows setting a value for defaultThumbnail + * + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail + */ + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + return getSelf(); + } + /** * This function allows setting a value for globalAssetId * * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(String globalAssetId) { + public B globalAssetId(Reference globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } @@ -69,26 +77,4 @@ public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } - - /** - * This function allows setting a value for assetType - * - * @param assetType desired value to be set - * @return Builder object with new value for assetType - */ - public B assetType(String assetType) { - getBuildingInstance().setAssetType(assetType); - return getSelf(); - } - - /** - * This function allows setting a value for defaultThumbnail - * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail - */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 353bf806d..6a3d80774 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,17 +23,6 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - /** * This function allows setting a value for direction * @@ -46,24 +35,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for state + * This function allows setting a value for lastUpdate * - * @param state desired value to be set - * @return Builder object with new value for state + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for maxInterval * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -79,13 +68,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for messageTopic * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -101,13 +90,24 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for observed * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param observed desired value to be set + * @return Builder object with new value for observed */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + + /** + * This function allows setting a value for state + * + * @param state desired value to be set + * @return Builder object with new value for state + */ + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } @@ -167,90 +167,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -275,4 +275,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index b59c42e61..f31291130 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -100,90 +100,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -208,4 +208,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index ce013e25b..111002598 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 9fd0aea26..2fcf75982 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -78,90 +78,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -186,4 +186,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 590b49285..68dee27fb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class ConceptDescriptionBuilder { /** - * This function allows setting a value for isCaseOfs + * This function allows setting a value for isCaseOf * - * @param isCaseOfs desired value to be set - * @return Builder object with new value for isCaseOfs + * @param isCaseOf desired value to be set + * @return Builder object with new value for isCaseOf */ - public B isCaseOfs(List isCaseOfs) { - getBuildingInstance().setIsCaseOfs(isCaseOfs); + public B isCaseOf(List isCaseOf) { + getBuildingInstance().setIsCaseOf(isCaseOf); return getSelf(); } /** - * This function allows adding a value to the List isCaseOfs + * This function allows adding a value to the List isCaseOf * * @param isCaseOf desired value to be added - * @return Builder object with new value for isCaseOfs + * @return Builder object with new value for isCaseOf */ public B isCaseOf(Reference isCaseOf) { - getBuildingInstance().getIsCaseOfs().add(isCaseOf); + getBuildingInstance().getIsCaseOf().add(isCaseOf); return getSelf(); } @@ -101,57 +101,68 @@ public B category(String category) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for checksum * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows setting a value for description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be set + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List description * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows adding a value to the List displayName * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index dab3a6b43..a37a1b854 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,72 +20,94 @@ import java.util.List; -public abstract class DataSpecificationIec61360Builder> +public abstract class DataSpecificationIEC61360Builder> extends ExtendableBuilder { /** - * This function allows setting a value for preferredNames + * This function allows setting a value for dataType * - * @param preferredNames desired value to be set - * @return Builder object with new value for preferredNames + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B preferredNames(List preferredNames) { - getBuildingInstance().setPreferredNames(preferredNames); + public B dataType(DataTypeIEC61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows adding a value to the List preferredNames + * This function allows setting a value for definition * - * @param preferredName desired value to be added - * @return Builder object with new value for preferredNames + * @param definition desired value to be set + * @return Builder object with new value for definition */ - public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { - getBuildingInstance().getPreferredNames().add(preferredName); + public B definition(List definition) { + getBuildingInstance().setDefinition(definition); return getSelf(); } /** - * This function allows setting a value for shortNames + * This function allows adding a value to the List definition * - * @param shortNames desired value to be set - * @return Builder object with new value for shortNames + * @param definition desired value to be added + * @return Builder object with new value for definition */ - public B shortNames(List shortNames) { - getBuildingInstance().setShortNames(shortNames); + public B definition(LangString definition) { + getBuildingInstance().getDefinition().add(definition); return getSelf(); } /** - * This function allows adding a value to the List shortNames + * This function allows setting a value for levelType * - * @param shortName desired value to be added - * @return Builder object with new value for shortNames + * @param levelType desired value to be set + * @return Builder object with new value for levelType */ - public B shortName(LangStringShortNameTypeIec61360 shortName) { - getBuildingInstance().getShortNames().add(shortName); + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); return getSelf(); } /** - * This function allows setting a value for unit + * This function allows setting a value for preferredName * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param preferredName desired value to be set + * @return Builder object with new value for preferredName */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B preferredName(List preferredName) { + getBuildingInstance().setPreferredName(preferredName); return getSelf(); } /** - * This function allows setting a value for unitId + * This function allows adding a value to the List preferredName * - * @param unitId desired value to be set - * @return Builder object with new value for unitId + * @param preferredName desired value to be added + * @return Builder object with new value for preferredName */ - public B unitId(Reference unitId) { - getBuildingInstance().setUnitId(unitId); + public B preferredName(LangString preferredName) { + getBuildingInstance().getPreferredName().add(preferredName); + return getSelf(); + } + + /** + * This function allows setting a value for shortName + * + * @param shortName desired value to be set + * @return Builder object with new value for shortName + */ + public B shortName(List shortName) { + getBuildingInstance().setShortName(shortName); + return getSelf(); + } + + /** + * This function allows adding a value to the List shortName + * + * @param shortName desired value to be added + * @return Builder object with new value for shortName + */ + public B shortName(LangString shortName) { + getBuildingInstance().getShortName().add(shortName); return getSelf(); } @@ -112,35 +134,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for dataType + * This function allows setting a value for unit * - * @param dataType desired value to be set - * @return Builder object with new value for dataType + * @param unit desired value to be set + * @return Builder object with new value for unit */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); + public B unit(String unit) { + getBuildingInstance().setUnit(unit); return getSelf(); } /** - * This function allows setting a value for definitions + * This function allows setting a value for unitId * - * @param definitions desired value to be set - * @return Builder object with new value for definitions + * @param unitId desired value to be set + * @return Builder object with new value for unitId */ - public B definitions(List definitions) { - getBuildingInstance().setDefinitions(definitions); + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); return getSelf(); } /** - * This function allows adding a value to the List definitions + * This function allows setting a value for value * - * @param definition desired value to be added - * @return Builder object with new value for definitions + * @param value desired value to be set + * @return Builder object with new value for value */ - public B definition(LangStringDefinitionTypeIec61360 definition) { - getBuildingInstance().getDefinitions().add(definition); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -166,26 +188,4 @@ public B valueList(ValueList valueList) { return getSelf(); } - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } - - /** - * This function allows setting a value for levelType - * - * @param levelType desired value to be set - * @return Builder object with new value for levelType - */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); - return getSelf(); - } - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java new file mode 100644 index 000000000..75998a955 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + +import java.util.List; + + +public abstract class DataSpecificationPhysicalUnitBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for conversionFactor + * + * @param conversionFactor desired value to be set + * @return Builder object with new value for conversionFactor + */ + public B conversionFactor(String conversionFactor) { + getBuildingInstance().setConversionFactor(conversionFactor); + return getSelf(); + } + + /** + * This function allows setting a value for definition + * + * @param definition desired value to be set + * @return Builder object with new value for definition + */ + public B definition(List definition) { + getBuildingInstance().setDefinition(definition); + return getSelf(); + } + + /** + * This function allows adding a value to the List definition + * + * @param definition desired value to be added + * @return Builder object with new value for definition + */ + public B definition(LangString definition) { + getBuildingInstance().getDefinition().add(definition); + return getSelf(); + } + + /** + * This function allows setting a value for dinNotation + * + * @param dinNotation desired value to be set + * @return Builder object with new value for dinNotation + */ + public B dinNotation(String dinNotation) { + getBuildingInstance().setDinNotation(dinNotation); + return getSelf(); + } + + /** + * This function allows setting a value for eceCode + * + * @param eceCode desired value to be set + * @return Builder object with new value for eceCode + */ + public B eceCode(String eceCode) { + getBuildingInstance().setEceCode(eceCode); + return getSelf(); + } + + /** + * This function allows setting a value for eceName + * + * @param eceName desired value to be set + * @return Builder object with new value for eceName + */ + public B eceName(String eceName) { + getBuildingInstance().setEceName(eceName); + return getSelf(); + } + + /** + * This function allows setting a value for nistName + * + * @param nistName desired value to be set + * @return Builder object with new value for nistName + */ + public B nistName(String nistName) { + getBuildingInstance().setNistName(nistName); + return getSelf(); + } + + /** + * This function allows setting a value for registrationAuthorityId + * + * @param registrationAuthorityId desired value to be set + * @return Builder object with new value for registrationAuthorityId + */ + public B registrationAuthorityId(String registrationAuthorityId) { + getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); + return getSelf(); + } + + /** + * This function allows setting a value for siName + * + * @param siName desired value to be set + * @return Builder object with new value for siName + */ + public B siName(String siName) { + getBuildingInstance().setSiName(siName); + return getSelf(); + } + + /** + * This function allows setting a value for siNotation + * + * @param siNotation desired value to be set + * @return Builder object with new value for siNotation + */ + public B siNotation(String siNotation) { + getBuildingInstance().setSiNotation(siNotation); + return getSelf(); + } + + /** + * This function allows setting a value for sourceOfDefinition + * + * @param sourceOfDefinition desired value to be set + * @return Builder object with new value for sourceOfDefinition + */ + public B sourceOfDefinition(String sourceOfDefinition) { + getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); + return getSelf(); + } + + /** + * This function allows setting a value for supplier + * + * @param supplier desired value to be set + * @return Builder object with new value for supplier + */ + public B supplier(String supplier) { + getBuildingInstance().setSupplier(supplier); + return getSelf(); + } + + /** + * This function allows setting a value for unitName + * + * @param unitName desired value to be set + * @return Builder object with new value for unitName + */ + public B unitName(String unitName) { + getBuildingInstance().setUnitName(unitName); + return getSelf(); + } + + /** + * This function allows setting a value for unitSymbol + * + * @param unitSymbol desired value to be set + * @return Builder object with new value for unitSymbol + */ + public B unitSymbol(String unitSymbol) { + getBuildingInstance().setUnitSymbol(unitSymbol); + return getSelf(); + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java new file mode 100644 index 000000000..85175e975 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; + +public abstract class DescriptorBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index 583f538af..68e175a75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java new file mode 100644 index 000000000..22c99fe99 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; + +public abstract class EndpointBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for interface + * + * @param interfaceValue desired value to be set + * @return Builder object with new value for interface + */ + public B withInterface(String interfaceValue) { + getBuildingInstance().setInterface(interfaceValue); + return getSelf(); + } + + /** + * This function allows setting a value for protocolInformation + * + * @param protocolInformation desired value to be set + * @return Builder object with new value for protocolInformation + */ + public B protocolInformation(ProtocolInformation protocolInformation) { + getBuildingInstance().setProtocolInformation(protocolInformation); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 616dad950..6065c8b97 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,28 +22,6 @@ public abstract class EntityBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for statements - * - * @param statements desired value to be set - * @return Builder object with new value for statements - */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); - return getSelf(); - } - /** * This function allows setting a value for entityType * @@ -61,30 +39,41 @@ public B entityType(EntityType entityType) { * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(String globalAssetId) { + public B globalAssetId(Reference globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } /** - * This function allows setting a value for specificAssetIds + * This function allows setting a value for specificAssetId + * + * @param specificAssetId desired value to be set + * @return Builder object with new value for specificAssetId + */ + public B specificAssetId(SpecificAssetId specificAssetId) { + getBuildingInstance().setSpecificAssetId(specificAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for statements * - * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetIds + * @param statements desired value to be set + * @return Builder object with new value for statements */ - public B specificAssetIds(List specificAssetIds) { - getBuildingInstance().setSpecificAssetIds(specificAssetIds); + public B statements(List statements) { + getBuildingInstance().setStatements(statements); return getSelf(); } /** - * This function allows adding a value to the List specificAssetIds + * This function allows adding a value to the List statements * - * @param specificAssetIds desired value to be added - * @return Builder object with new value for specificAssetIds + * @param statements desired value to be added + * @return Builder object with new value for statements */ - public B specificAssetIds(SpecificAssetId specificAssetIds) { - getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); return getSelf(); } @@ -144,90 +133,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -252,4 +241,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index 633cf775c..0c10eab94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -48,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index 6aeaad75b..64012e1fb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,57 +23,57 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for source + * This function allows setting a value for observableReference * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for sourceSemanticId + * This function allows setting a value for observableSemanticId * - * @param sourceSemanticId desired value to be set - * @return Builder object with new value for sourceSemanticId + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B sourceSemanticId(Reference sourceSemanticId) { - getBuildingInstance().setSourceSemanticId(sourceSemanticId); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for observableReference + * This function allows setting a value for payload * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B payload(String payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } /** - * This function allows setting a value for observableSemanticId + * This function allows setting a value for source * - * @param observableSemanticId desired value to be set - * @return Builder object with new value for observableSemanticId + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableSemanticId(Reference observableSemanticId) { - getBuildingInstance().setObservableSemanticId(observableSemanticId); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for topic + * This function allows setting a value for sourceSemanticId * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } @@ -100,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for payload + * This function allows setting a value for topic * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B payload(byte[] payload) { - getBuildingInstance().setPayload(payload); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index 0ec24c7d3..624c24af8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,13 +36,13 @@ public B name(String name) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for refersTo * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTo desired value to be set + * @return Builder object with new value for refersTo */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(Reference refersTo) { + getBuildingInstance().setRefersTo(refersTo); return getSelf(); } @@ -58,24 +58,13 @@ public B value(String value) { } /** - * This function allows setting a value for refersTos - * - * @param refersTos desired value to be set - * @return Builder object with new value for refersTos - */ - public B refersTos(List refersTos) { - getBuildingInstance().setRefersTos(refersTos); - return getSelf(); - } - - /** - * This function allows adding a value to the List refersTos + * This function allows setting a value for valueType * - * @param refersTo desired value to be added - * @return Builder object with new value for refersTos + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(Reference refersTo) { - getBuildingInstance().getRefersTos().add(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index fd6722b88..e8585a2da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } @@ -100,90 +100,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -208,4 +208,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java new file mode 100644 index 000000000..6b0c50df8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; + + +public abstract class LangStringBuilder> extends ExtendableBuilder { + + /** + * + * This function allows setting a value for text + * + * @param text desired value to be set + * + * @return Builder object with new value for text + * + */ + + public B text(String text) { + getBuildingInstance().setText(text); + return getSelf(); + } + + /** + * + * This function allows setting a value for language + * + * @param language desired value to be set + * + * @return Builder object with new value for language + * + */ + + public B language(String language) { + getBuildingInstance().setLanguage(language); + return getSelf(); + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index d5b2c1905..8e00bcb14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class MultiLanguagePropertyBuilder { /** - * This function allows setting a value for values + * This function allows setting a value for value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be set + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(List value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows adding a value to the List value * * @param value desired value to be added - * @return Builder object with new value for values + * @return Builder object with new value for value */ - public B value(LangStringTextType value) { - getBuildingInstance().getValues().add(value); + public B value(LangString value) { + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -112,90 +112,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -220,4 +220,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index bcec85472..7ab8280cb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,28 @@ public abstract class OperationBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for inputVariables * @@ -66,28 +88,6 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -144,90 +144,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -252,4 +252,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index 0bd67baa7..fb89de487 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,17 +22,6 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for value * @@ -55,6 +44,17 @@ public B valueId(Reference valueId) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -111,90 +111,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -219,4 +219,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java new file mode 100644 index 000000000..e158128d3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; + +public abstract class ProtocolInformationBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for endpointAddress + * + * @param endpointAddress desired value to be set + * @return Builder object with new value for endpointAddress + */ + public B endpointAddress(String endpointAddress) { + getBuildingInstance().setEndpointAddress(endpointAddress); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocol + * + * @param endpointProtocol desired value to be set + * @return Builder object with new value for endpointProtocol + */ + public B endpointProtocol(String endpointProtocol) { + getBuildingInstance().setEndpointProtocol(endpointProtocol); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocolVersion + * + * @param endpointProtocolVersion desired value to be set + * @return Builder object with new value for endpointProtocolVersion + */ + public B endpointProtocolVersion(String endpointProtocolVersion) { + getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersion); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocol + * + * @param subprotocol desired value to be set + * @return Builder object with new value for subprotocol + */ + public B subprotocol(String subprotocol) { + getBuildingInstance().setSubprotocol(subprotocol); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBody + * + * @param subprotocolBody desired value to be set + * @return Builder object with new value for subprotocolBody + */ + public B subprotocolBody(String subprotocolBody) { + getBuildingInstance().setSubprotocolBody(subprotocolBody); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value to be set + * @return Builder object with new value for subprotocolBodyEncoding + */ + public B subprotocolBodyEncoding(String subprotocolBodyEncoding) { + getBuildingInstance().setSubprotocolBodyEncoding(subprotocolBodyEncoding); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index 4eeb6a010..8e7d7b74d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -47,17 +47,6 @@ public B type(String type) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for value * @@ -80,6 +69,17 @@ public B valueId(Reference valueId) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 1bf999673..35472b5f4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -45,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -111,90 +111,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -219,4 +219,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 3142190f5..0af106b32 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for type + * This function allows setting a value for keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for referredSemanticId + * This function allows adding a value to the List keys * - * @param referredSemanticId desired value to be set - * @return Builder object with new value for referredSemanticId + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B referredSemanticId(Reference referredSemanticId) { - getBuildingInstance().setReferredSemanticId(referredSemanticId); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } /** - * This function allows setting a value for keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for type * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index cf3587b09..e7eabbeec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -90,90 +90,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -198,4 +198,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index ee8ffa434..b5fa9c32b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -101,90 +101,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -209,4 +209,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index f7c03b676..6bd878ef7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java new file mode 100644 index 000000000..188a7a8f2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + +import java.util.List; + + +public abstract class SpecificAssetIdBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for externalSubjectId + * + * @param externalSubjectId desired value to be set + * @return Builder object with new value for externalSubjectId + */ + public B externalSubjectId(Reference externalSubjectId) { + getBuildingInstance().setExternalSubjectId(externalSubjectId); + return getSelf(); + } + + /** + * This function allows setting a value for name + * + * @param name desired value to be set + * @return Builder object with new value for name + */ + public B name(String name) { + getBuildingInstance().setName(name); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index c8fff70dc..a4a25425c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -67,79 +67,90 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for kind + * This function allows setting a value for administration * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for semanticId + * This function allows setting a value for id * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId + * @param id desired value to be set + * @return Builder object with new value for id */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows setting a value for category * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param category desired value to be set + * @return Builder object with new value for category */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for checksum * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for administration + * This function allows setting a value for description * - * @param administration desired value to be set - * @return Builder object with new value for administration + * @param description desired value to be set + * @return Builder object with new value for description */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for id + * This function allows adding a value to the List description * - * @param id desired value to be set - * @return Builder object with new value for id + * @param description desired value to be added + * @return Builder object with new value for description */ - public B id(String id) { - getBuildingInstance().setId(id); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for displayName * - * @param category desired value to be set - * @return Builder object with new value for category + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } @@ -155,68 +166,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for displayNames + * This function allows setting a value for extensions * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows adding a value to the List extensions * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows setting a value for semanticId * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for supplementalSemanticIds * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for extensions + * This function allows adding a value to the List supplementalSemanticIds * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows setting a value for kind * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java new file mode 100644 index 000000000..76f32ed66 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +public abstract class SubmodelDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param description desired value to be set + * @return Builder object with new value for description + */ + public B description(List description) { + getBuildingInstance().setDescription(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayName desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for identification + * + * @param identification desired value to be set + * @return Builder object with new value for identification + */ + public B identification(String identification) { + getBuildingInstance().setIdentification(identification); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index 7a97d7a7f..dbaa9905b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; +import java.util.Collection; import java.util.List; @@ -24,24 +25,24 @@ public abstract class SubmodelElementCollectionBuilder { /** - * This function allows setting a value for values + * This function allows setting a value for value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be set + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(Collection value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows adding a value to the List value * * @param value desired value to be added - * @return Builder object with new value for values + * @return Builder object with new value for value */ public B value(SubmodelElement value) { - getBuildingInstance().getValues().add(value); + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -101,90 +102,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -209,4 +210,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index a346c19ef..f677a5553 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -57,35 +57,35 @@ public B typeValueListElement(AasSubmodelElements typeValueListElement) { } /** - * This function allows setting a value for valueTypeListElement + * This function allows setting a value for value * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be set + * @return Builder object with new value for value */ - public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(List value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for values + * This function allows adding a value to the List value * - * @param values desired value to be set - * @return Builder object with new value for values + * @param value desired value to be added + * @return Builder object with new value for value */ - public B values(List values) { - getBuildingInstance().setValues(values); + public B value(SubmodelElement value) { + getBuildingInstance().getValue().add(value); return getSelf(); } /** - * This function allows adding a value to the List values + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be added - * @return Builder object with new value for values + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(SubmodelElement value) { - getBuildingInstance().getValues().add(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } @@ -145,90 +145,90 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for qualifiers + * This function allows setting a value for kind * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B kind(ModelingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for category * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param category desired value to be set + * @return Builder object with new value for category */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for checksum * - * @param category desired value to be set - * @return Builder object with new value for category + * @param checksum desired value to be set + * @return Builder object with new value for checksum */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B checksum(String checksum) { + getBuildingInstance().setChecksum(checksum); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param description desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List description) { + getBuildingInstance().setDescription(description); return getSelf(); } /** - * This function allows setting a value for displayNames + * This function allows adding a value to the List description * - * @param displayNames desired value to be set - * @return Builder object with new value for displayNames + * @param description desired value to be added + * @return Builder object with new value for description */ - public B displayNames(List displayNames) { - getBuildingInstance().setDisplayNames(displayNames); + public B description(LangString description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List displayNames + * This function allows setting a value for displayName * - * @param displayName desired value to be added - * @return Builder object with new value for displayNames + * @param displayName desired value to be set + * @return Builder object with new value for displayName */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayNames().add(displayName); + public B displayName(List displayName) { + getBuildingInstance().setDisplayName(displayName); return getSelf(); } /** - * This function allows setting a value for descriptions + * This function allows adding a value to the List displayName * - * @param descriptions desired value to be set - * @return Builder object with new value for descriptions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B descriptions(List descriptions) { - getBuildingInstance().setDescriptions(descriptions); + public B displayName(LangString displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List descriptions + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for descriptions + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescriptions().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } @@ -253,4 +253,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index dd9bbe22e..9a86cd699 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AdministrativeInformationBuilder; @@ -36,29 +35,23 @@ @IRI("aas:AdministrativeInformation") public class DefaultAdministrativeInformation implements AdministrativeInformation { - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") - protected Reference creator; - - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") - protected String templateId; - - @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") protected String version; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() {} + public DefaultAdministrativeInformation() { + + } @Override public int hashCode() { - return Objects.hash(this.version, - this.revision, - this.creator, - this.templateId, + return Objects.hash(this.revision, + this.version, this.embeddedDataSpecifications); } @@ -72,24 +65,12 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.version, other.version) && - Objects.equals(this.revision, other.revision) && - Objects.equals(this.creator, other.creator) && - Objects.equals(this.templateId, other.templateId) && + return Objects.equals(this.revision, other.revision) && + Objects.equals(this.version, other.version) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } - @Override - public String getVersion() { - return version; - } - - @Override - public void setVersion(String version) { - this.version = version; - } - @Override public String getRevision() { return revision; @@ -101,23 +82,13 @@ public void setRevision(String revision) { } @Override - public Reference getCreator() { - return creator; - } - - @Override - public void setCreator(Reference creator) { - this.creator = creator; - } - - @Override - public String getTemplateId() { - return templateId; + public String getVersion() { + return version; } @Override - public void setTemplateId(String templateId) { - this.templateId = templateId; + public void setVersion(String version) { + this.version = version; } @Override @@ -130,16 +101,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - public String toString() { - return String.format( - "DefaultAdministrativeInformation (" + "version=%s," - + "revision=%s," - + "creator=%s," - + "templateId=%s," - + ")", - this.version, this.revision, this.creator, this.templateId); - } - /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 8a4f964a8..b92558245 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,43 +35,53 @@ @IRI("aas:AnnotatedRelationshipElement") public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") protected List annotations = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() {} + public DefaultAnnotatedRelationshipElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -81,12 +91,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -105,12 +117,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -175,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -195,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,11 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultAnnotatedRelationshipElement (" + "annotations=%s," - + ")", - this.annotations); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 13bc5b590..ffc80b112 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,53 +33,59 @@ @IRI("aas:AssetAdministrationShell") public class DefaultAssetAdministrationShell implements AssetAdministrationShell { - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") protected AssetInformation assetInformation; - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") protected Reference derivedFrom; - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") protected List submodels = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() {} + public DefaultAssetAdministrationShell() { + + } @Override public int hashCode() { - return Objects.hash(this.derivedFrom, - this.assetInformation, + return Objects.hash(this.assetInformation, + this.derivedFrom, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions); } @@ -93,38 +99,39 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.derivedFrom, other.derivedFrom) && - Objects.equals(this.assetInformation, other.assetInformation) && + return Objects.equals(this.assetInformation, other.assetInformation) && + Objects.equals(this.derivedFrom, other.derivedFrom) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override @@ -178,33 +185,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; } @Override - public List getDisplayNames() { - return displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public List getDisplayName() { + return displayName; } @Override - public List getDescriptions() { - return descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,15 +234,6 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultAssetAdministrationShell (" + "derivedFrom=%s," - + "assetInformation=%s," - + "submodels=%s," - + ")", - this.derivedFrom, this.assetInformation, this.submodels); - } - /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..998f3dd4e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellDescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@IRI("aas:AssetAdministrationShellDescriptor") +public class DefaultAssetAdministrationShellDescriptor implements AssetAdministrationShellDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") + protected List description; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") + protected List displayName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/identification") + protected String identification; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") + protected Reference globalAssetId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") + protected SpecificAssetId specificAssetId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") + protected List submodelDescriptor; + + + public DefaultAssetAdministrationShellDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.description, + this.displayName, + this.idShort, + this.identification, + this.globalAssetId, + this.specificAssetId, + this.submodelDescriptor, + this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAssetAdministrationShellDescriptor other = (DefaultAssetAdministrationShellDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.identification, other.identification) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.specificAssetId, other.specificAssetId) && + Objects.equals(this.submodelDescriptor, other.submodelDescriptor) && + Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getIdentification() { + return identification; + } + + @Override + public void setIdentification(String identification) { + this.identification = identification; + } + + @Override + public Reference getGlobalAssetId() { + return globalAssetId; + } + + @Override + public void setGlobalAssetId(Reference globalAssetId) { + this.globalAssetId = globalAssetId; + } + + @Override + public SpecificAssetId getSpecificAssetIds() { + return specificAssetId; + } + + @Override + public void setSpecificAssetIds(SpecificAssetId specificAssetId) { + this.specificAssetId = specificAssetId; + } + + @Override + public List getSubmodelDescriptor() { + return submodelDescriptor; + } + + @Override + public void setSubmodelDescriptor(List submodelDescriptor) { + this.submodelDescriptor = submodelDescriptor; + } + + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultAssetAdministrationShellDescriptor bean. + */ + public static class Builder extends AssetAdministrationShellDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAssetAdministrationShellDescriptor newBuildingInstance() { + return new DefaultAssetAdministrationShellDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index eaaeff408..9b31fb191 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,10 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -37,30 +34,28 @@ @IRI("aas:AssetInformation") public class DefaultAssetInformation implements AssetInformation { - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") protected AssetKind assetKind; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") - protected String assetType; - - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") - protected String globalAssetId; + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + protected Reference globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() {} + public DefaultAssetInformation() { + + } @Override public int hashCode() { return Objects.hash(this.assetKind, + this.defaultThumbnail, this.globalAssetId, - this.specificAssetIds, - this.assetType, - this.defaultThumbnail); + this.specificAssetIds); } @Override @@ -74,10 +69,9 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.assetType, other.assetType) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail); + Objects.equals(this.specificAssetIds, other.specificAssetIds); } } @@ -92,54 +86,33 @@ public void setAssetKind(AssetKind assetKind) { } @Override - public String getGlobalAssetId() { - return globalAssetId; - } - - @Override - public void setGlobalAssetId(String globalAssetId) { - this.globalAssetId = globalAssetId; - } - - @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public Resource getDefaultThumbnail() { + return defaultThumbnail; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; } @Override - public String getAssetType() { - return assetType; + public Reference getGlobalAssetId() { + return globalAssetId; } @Override - public void setAssetType(String assetType) { - this.assetType = assetType; + public void setGlobalAssetId(Reference globalAssetId) { + this.globalAssetId = globalAssetId; } @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; - } - - public String toString() { - return String.format( - "DefaultAssetInformation (" + "assetKind=%s," - + "globalAssetId=%s," - + "specificAssetIds=%s," - + "assetType=%s," - + "defaultThumbnail=%s," - + ")", - this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index d7fda6b91..7cdf7feb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,78 +33,90 @@ @IRI("aas:BasicEventElement") public class DefaultBasicEventElement implements BasicEventElement { - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") protected Direction direction; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") protected String lastUpdate; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") protected String maxInterval; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") protected Reference messageBroker; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") protected String messageTopic; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") protected String minInterval; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") protected Reference observed; - @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") protected StateOfEvent state; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() {} + public DefaultBasicEventElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.observed, - this.direction, - this.state, - this.messageTopic, - this.messageBroker, + return Objects.hash(this.direction, this.lastUpdate, - this.minInterval, this.maxInterval, + this.messageBroker, + this.messageTopic, + this.minInterval, + this.observed, + this.state, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -117,36 +129,28 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.observed, other.observed) && - Objects.equals(this.direction, other.direction) && - Objects.equals(this.state, other.state) && - Objects.equals(this.messageTopic, other.messageTopic) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.direction, other.direction) && Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.minInterval, other.minInterval) && Objects.equals(this.maxInterval, other.maxInterval) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.minInterval, other.minInterval) && + Objects.equals(this.observed, other.observed) && + Objects.equals(this.state, other.state) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - @Override public Direction getDirection() { return direction; @@ -158,23 +162,23 @@ public void setDirection(Direction direction) { } @Override - public StateOfEvent getState() { - return state; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override - public String getMessageTopic() { - return messageTopic; + public String getMaxInterval() { + return maxInterval; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -188,13 +192,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getLastUpdate() { - return lastUpdate; + public String getMessageTopic() { + return messageTopic; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -208,13 +212,23 @@ public void setMinInterval(String minInterval) { } @Override - public String getMaxInterval() { - return maxInterval; + public Reference getObserved() { + return observed; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setObserved(Reference observed) { + this.observed = observed; + } + + @Override + public StateOfEvent getState() { + return state; + } + + @Override + public void setState(StateOfEvent state) { + this.state = state; } @Override @@ -248,13 +262,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -268,33 +282,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -307,19 +331,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultBasicEventElement (" + "observed=%s," - + "direction=%s," - + "state=%s," - + "messageTopic=%s," - + "messageBroker=%s," - + "lastUpdate=%s," - + "minInterval=%s," - + "maxInterval=%s," - + ")", - this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, - this.maxInterval); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** From 61258fac782581e85a30a1aaa7132378098bbc60 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 30 Jun 2023 09:37:48 +0200 Subject: [PATCH 09/91] Update model project --- .../aas4j/v3/model/impl/DefaultBlob.java | 144 ++++++---- .../v3/model/impl/DefaultCapability.java | 112 +++++--- .../model/impl/DefaultConceptDescription.java | 100 ++++--- .../DefaultDataSpecificationIec61360.java | 201 ++++++------- .../DefaultDataSpecificationPhysicalUnit.java | 268 ++++++++++++++++++ .../v3/model/impl/DefaultDescriptor.java | 80 ++++++ .../DefaultEmbeddedDataSpecification.java | 20 +- .../aas4j/v3/model/impl/DefaultEndpoint.java | 93 ++++++ .../aas4j/v3/model/impl/DefaultEntity.java | 172 ++++++----- .../v3/model/impl/DefaultEnvironment.java | 47 ++- .../v3/model/impl/DefaultEventPayload.java | 110 ++++--- .../aas4j/v3/model/impl/DefaultExtension.java | 58 ++-- .../aas4j/v3/model/impl/DefaultFile.java | 144 ++++++---- .../aas4j/v3/model/impl/DefaultKey.java | 20 +- .../v3/model/impl/DefaultLangString.java | 113 ++++++++ .../impl/DefaultMultiLanguageProperty.java | 134 +++++---- .../aas4j/v3/model/impl/DefaultOperation.java | 149 ++++++---- .../model/impl/DefaultOperationVariable.java | 13 +- .../aas4j/v3/model/impl/DefaultProperty.java | 151 ++++++---- .../impl/DefaultProtocolInformation.java | 152 ++++++++++ .../aas4j/v3/model/impl/DefaultQualifier.java | 58 ++-- .../aas4j/v3/model/impl/DefaultRange.java | 147 ++++++---- .../aas4j/v3/model/impl/DefaultReference.java | 47 ++- .../model/impl/DefaultReferenceElement.java | 117 +++++--- .../impl/DefaultRelationshipElement.java | 118 +++++--- .../aas4j/v3/model/impl/DefaultResource.java | 44 ++- .../v3/model/impl/DefaultSpecificAssetId.java | 148 ++++++++++ .../aas4j/v3/model/impl/DefaultSubmodel.java | 156 +++++----- .../model/impl/DefaultSubmodelDescriptor.java | 173 +++++++++++ 29 files changed, 2262 insertions(+), 1027 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 7bf8f2a70..682d2d09d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,54 +35,68 @@ @IRI("aas:Blob") public class DefaultBlob implements Blob { - @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/Blob/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") protected byte[] value; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultBlob() {} + public DefaultBlob() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(Arrays.hashCode(this.value), - this.contentType, + return Objects.hash(this.contentType, + Arrays.hashCode(this.value), this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -95,38 +109,40 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Arrays.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && + return Objects.equals(this.contentType, other.contentType) && + Arrays.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override @@ -160,13 +176,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -180,33 +196,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,12 +245,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultBlob (" + "value=%s," - + "contentType=%s," - + ")", - this.value, this.contentType); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 4f7a63e40..0a2a528a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,46 +34,58 @@ @IRI("aas:Capability") public class DefaultCapability implements Capability { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultCapability() {} + public DefaultCapability() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -89,12 +101,14 @@ public boolean equals(Object obj) { return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -129,13 +143,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -149,33 +163,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,12 +212,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultCapability (" - + ")" + @Override + public List getQualifiers() { + return qualifiers; + } - ); + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 62a5cb678..d0b7fcbb6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,45 +34,53 @@ @IRI("aas:ConceptDescription") public class DefaultConceptDescription implements ConceptDescription { - @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") - protected List isCaseOfs = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + protected List isCaseOf = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultConceptDescription() {} + public DefaultConceptDescription() { + + this.category = "PROPERTY"; + + } @Override public int hashCode() { - return Objects.hash(this.isCaseOfs, + return Objects.hash(this.isCaseOf, this.embeddedDataSpecifications, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions); } @@ -86,26 +94,27 @@ public boolean equals(Object obj) { return false; } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; - return Objects.equals(this.isCaseOfs, other.isCaseOfs) && + return Objects.equals(this.isCaseOf, other.isCaseOf) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions); } } @Override - public List getIsCaseOfs() { - return isCaseOfs; + public List getIsCaseOf() { + return isCaseOf; } @Override - public void setIsCaseOfs(List isCaseOfs) { - this.isCaseOfs = isCaseOfs; + public void setIsCaseOf(List isCaseOf) { + this.isCaseOf = isCaseOf; } @Override @@ -149,33 +158,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,13 +207,6 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultConceptDescription (" + "isCaseOfs=%s," - + ")", - this.isCaseOfs); - } - /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 799f3cee9..7c26835ce 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIEC61360Builder; import java.util.ArrayList; import java.util.List; @@ -26,67 +26,69 @@ /** * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360 + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360 * * Content of data specification template for concept descriptions for properties, values and value * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIec61360") -public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { +@IRI("aas:DataSpecificationIEC61360") +public class DefaultDataSpecificationIEC61360 implements DataSpecificationIEC61360 { - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") - protected DataTypeIec61360 dataType; + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") + protected DataTypeIEC61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") - protected List definitions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") - protected List preferredNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") - protected List shortNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() {} + public DefaultDataSpecificationIEC61360() { + + } @Override public int hashCode() { - return Objects.hash(this.preferredNames, - this.shortNames, - this.unit, - this.unitId, + return Objects.hash(this.dataType, + this.definition, + this.levelType, + this.preferredName, + this.shortName, this.sourceOfDefinition, this.symbol, - this.dataType, - this.definitions, - this.valueFormat, - this.valueList, + this.unit, + this.unitId, this.value, - this.levelType); + this.valueFormat, + this.valueList); } @Override @@ -98,60 +100,70 @@ public boolean equals(Object obj) { } else if (this.getClass() != obj.getClass()) { return false; } else { - DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.preferredNames, other.preferredNames) && - Objects.equals(this.shortNames, other.shortNames) && - Objects.equals(this.unit, other.unit) && - Objects.equals(this.unitId, other.unitId) && + DefaultDataSpecificationIEC61360 other = (DefaultDataSpecificationIEC61360) obj; + return Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definition, other.definition) && + Objects.equals(this.levelType, other.levelType) && + Objects.equals(this.preferredName, other.preferredName) && + Objects.equals(this.shortName, other.shortName) && Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && Objects.equals(this.symbol, other.symbol) && - Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definitions, other.definitions) && - Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.unit, other.unit) && + Objects.equals(this.unitId, other.unitId) && Objects.equals(this.value, other.value) && - Objects.equals(this.levelType, other.levelType); + Objects.equals(this.valueFormat, other.valueFormat) && + Objects.equals(this.valueList, other.valueList); } } @Override - public List getPreferredNames() { - return preferredNames; + public DataTypeIEC61360 getDataType() { + return dataType; } @Override - public void setPreferredNames(List preferredNames) { - this.preferredNames = preferredNames; + public void setDataType(DataTypeIEC61360 dataType) { + this.dataType = dataType; } @Override - public List getShortNames() { - return shortNames; + public List getDefinition() { + return definition; } @Override - public void setShortNames(List shortNames) { - this.shortNames = shortNames; + public void setDefinition(List definition) { + this.definition = definition; } @Override - public String getUnit() { - return unit; + public LevelType getLevelType() { + return levelType; } @Override - public void setUnit(String unit) { - this.unit = unit; + public void setLevelType(LevelType levelType) { + this.levelType = levelType; } @Override - public Reference getUnitId() { - return unitId; + public List getPreferredName() { + return preferredName; } @Override - public void setUnitId(Reference unitId) { - this.unitId = unitId; + public void setPreferredName(List preferredName) { + this.preferredName = preferredName; + } + + @Override + public List getShortName() { + return shortName; + } + + @Override + public void setShortName(List shortName) { + this.shortName = shortName; } @Override @@ -175,23 +187,33 @@ public void setSymbol(String symbol) { } @Override - public DataTypeIec61360 getDataType() { - return dataType; + public String getUnit() { + return unit; } @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getDefinitions() { - return definitions; + public Reference getUnitId() { + return unitId; } @Override - public void setDefinitions(List definitions) { - this.definitions = definitions; + public void setUnitId(Reference unitId) { + this.unitId = unitId; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; } @Override @@ -214,49 +236,10 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - @Override - public LevelType getLevelType() { - return levelType; - } - - @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; - } - - public String toString() { - return String.format( - "DefaultDataSpecificationIec61360 (" + "preferredNames=%s," - + "shortNames=%s," - + "unit=%s," - + "unitId=%s," - + "sourceOfDefinition=%s," - + "symbol=%s," - + "dataType=%s," - + "definitions=%s," - + "valueFormat=%s," - + "valueList=%s," - + "value=%s," - + "levelType=%s," - + ")", - this.preferredNames, this.shortNames, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, - this.definitions, this.valueFormat, this.valueList, this.value, this.levelType); - } - /** - * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. + * This builder class can be used to construct a DefaultDataSpecificationIEC61360 bean. */ - public static class Builder extends DataSpecificationIec61360Builder { + public static class Builder extends DataSpecificationIEC61360Builder { @Override protected Builder getSelf() { @@ -264,8 +247,8 @@ protected Builder getSelf() { } @Override - protected DefaultDataSpecificationIec61360 newBuildingInstance() { - return new DefaultDataSpecificationIec61360(); + protected DefaultDataSpecificationIEC61360 newBuildingInstance() { + return new DefaultDataSpecificationIEC61360(); } } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..5abc284d3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit + * + */ + +@IRI("aas:DataSpecificationPhysicalUnit") +public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") + protected String conversionFactor; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") + protected List definition = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") + protected String dinNotation; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") + protected String eceCode; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") + protected String eceName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") + protected String nistName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") + protected String registrationAuthorityId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") + protected String siName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") + protected String siNotation; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") + protected String sourceOfDefinition; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") + protected String supplier; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") + protected String unitName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") + protected String unitSymbol; + + public DefaultDataSpecificationPhysicalUnit() { + + } + + @Override + public int hashCode() { + return Objects.hash(this.conversionFactor, + this.definition, + this.dinNotation, + this.eceCode, + this.eceName, + this.nistName, + this.registrationAuthorityId, + this.siName, + this.siNotation, + this.sourceOfDefinition, + this.supplier, + this.unitName, + this.unitSymbol); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; + return Objects.equals(this.conversionFactor, other.conversionFactor) && + Objects.equals(this.definition, other.definition) && + Objects.equals(this.dinNotation, other.dinNotation) && + Objects.equals(this.eceCode, other.eceCode) && + Objects.equals(this.eceName, other.eceName) && + Objects.equals(this.nistName, other.nistName) && + Objects.equals(this.registrationAuthorityId, other.registrationAuthorityId) && + Objects.equals(this.siName, other.siName) && + Objects.equals(this.siNotation, other.siNotation) && + Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && + Objects.equals(this.supplier, other.supplier) && + Objects.equals(this.unitName, other.unitName) && + Objects.equals(this.unitSymbol, other.unitSymbol); + } + } + + @Override + public String getConversionFactor() { + return conversionFactor; + } + + @Override + public void setConversionFactor(String conversionFactor) { + this.conversionFactor = conversionFactor; + } + + @Override + public List getDefinition() { + return definition; + } + + @Override + public void setDefinition(List definition) { + this.definition = definition; + } + + @Override + public String getDinNotation() { + return dinNotation; + } + + @Override + public void setDinNotation(String dinNotation) { + this.dinNotation = dinNotation; + } + + @Override + public String getEceCode() { + return eceCode; + } + + @Override + public void setEceCode(String eceCode) { + this.eceCode = eceCode; + } + + @Override + public String getEceName() { + return eceName; + } + + @Override + public void setEceName(String eceName) { + this.eceName = eceName; + } + + @Override + public String getNistName() { + return nistName; + } + + @Override + public void setNistName(String nistName) { + this.nistName = nistName; + } + + @Override + public String getRegistrationAuthorityId() { + return registrationAuthorityId; + } + + @Override + public void setRegistrationAuthorityId(String registrationAuthorityId) { + this.registrationAuthorityId = registrationAuthorityId; + } + + @Override + public String getSiName() { + return siName; + } + + @Override + public void setSiName(String siName) { + this.siName = siName; + } + + @Override + public String getSiNotation() { + return siNotation; + } + + @Override + public void setSiNotation(String siNotation) { + this.siNotation = siNotation; + } + + @Override + public String getSourceOfDefinition() { + return sourceOfDefinition; + } + + @Override + public void setSourceOfDefinition(String sourceOfDefinition) { + this.sourceOfDefinition = sourceOfDefinition; + } + + @Override + public String getSupplier() { + return supplier; + } + + @Override + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + @Override + public String getUnitName() { + return unitName; + } + + @Override + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + @Override + public String getUnitSymbol() { + return unitSymbol; + } + + @Override + public void setUnitSymbol(String unitSymbol) { + this.unitSymbol = unitSymbol; + } + + /** + * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. + */ + public static class Builder extends DataSpecificationPhysicalUnitBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { + return new DefaultDataSpecificationPhysicalUnit(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java new file mode 100644 index 000000000..c1a915ca5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@IRI("aas:Descriptor") +public class DefaultDescriptor implements Descriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + public DefaultDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDescriptor other = (DefaultDescriptor) obj; + return Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultDescriptor bean. + */ + public static class Builder extends DescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDescriptor newBuildingInstance() { + return new DefaultDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 093108949..16d9fe711 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,13 +34,15 @@ @IRI("aas:EmbeddedDataSpecification") public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecification { - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") protected Reference dataSpecification; - @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() {} + public DefaultEmbeddedDataSpecification() { + + } @Override public int hashCode() { @@ -83,14 +85,6 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } - public String toString() { - return String.format( - "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," - + "dataSpecificationContent=%s," - + ")", - this.dataSpecification, this.dataSpecificationContent); - } - /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java new file mode 100644 index 000000000..648e4859d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.EndpointBuilder; + +import java.util.Objects; + +@IRI("aas:Endpoint") +public class DefaultEndpoint implements Endpoint { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/_interface") + protected String interfaceValue; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + protected ProtocolInformation protocolInformation; + + public DefaultEndpoint() { + } + + @Override + public int hashCode() { + return Objects.hash(this.interfaceValue, + this.protocolInformation); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultEndpoint other = (DefaultEndpoint) obj; + return Objects.equals(this.interfaceValue, other.interfaceValue) && + Objects.equals(this.protocolInformation, other.protocolInformation); + } + } + + @Override + public String getInterface() { + return interfaceValue; + } + + @Override + public void setInterface(String interfaceValue) { + this.interfaceValue = interfaceValue; + } + + @Override + public ProtocolInformation getProtocolInformation() { + return protocolInformation; + } + + @Override + public void setProtocolInformation(ProtocolInformation protocolInformation) { + this.protocolInformation = protocolInformation; + } + + /** + * This builder class can be used to construct a DefaultEndpoint bean. + */ + public static class Builder extends EndpointBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultEndpoint newBuildingInstance() { + return new DefaultEndpoint(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index f049cb13f..979271811 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,62 +33,74 @@ @IRI("aas:Entity") public class DefaultEntity implements Entity { - @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") - protected String globalAssetId; + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + protected Reference globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") + protected SpecificAssetId specificAssetId; - @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") protected List statements = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultEntity() {} + public DefaultEntity() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.statements, - this.entityType, + return Objects.hash(this.entityType, this.globalAssetId, - this.specificAssetIds, + this.specificAssetId, + this.statements, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -101,32 +113,24 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.statements, other.statements) && - Objects.equals(this.entityType, other.entityType) && + return Objects.equals(this.entityType, other.entityType) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.specificAssetId, other.specificAssetId) && + Objects.equals(this.statements, other.statements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public List getStatements() { - return statements; - } - - @Override - public void setStatements(List statements) { - this.statements = statements; - } - @Override public EntityType getEntityType() { return entityType; @@ -138,23 +142,33 @@ public void setEntityType(EntityType entityType) { } @Override - public String getGlobalAssetId() { + public Reference getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(String globalAssetId) { + public void setGlobalAssetId(Reference globalAssetId) { this.globalAssetId = globalAssetId; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public SpecificAssetId getSpecificAssetId() { + return specificAssetId; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setSpecificAssetId(SpecificAssetId specificAssetId) { + this.specificAssetId = specificAssetId; + } + + @Override + public List getStatements() { + return statements; + } + + @Override + public void setStatements(List statements) { + this.statements = statements; } @Override @@ -188,13 +202,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -208,33 +222,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -247,14 +271,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultEntity (" + "statements=%s," - + "entityType=%s," - + "globalAssetId=%s," - + "specificAssetIds=%s," - + ")", - this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 53367b728..012b4aca8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,22 +36,24 @@ @IRI("aas:Environment") public class DefaultEnvironment implements Environment { - @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") protected List assetAdministrationShells = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") protected List conceptDescriptions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() {} + public DefaultEnvironment() { + + } @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.submodels, - this.conceptDescriptions); + this.conceptDescriptions, + this.submodels); } @Override @@ -65,8 +67,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions); + Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && + Objects.equals(this.submodels, other.submodels); } } @@ -80,16 +82,6 @@ public void setAssetAdministrationShells(List assetAdm this.assetAdministrationShells = assetAdministrationShells; } - @Override - public List getSubmodels() { - return submodels; - } - - @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; - } - @Override public List getConceptDescriptions() { return conceptDescriptions; @@ -100,13 +92,14 @@ public void setConceptDescriptions(List conceptDescriptions) this.conceptDescriptions = conceptDescriptions; } - public String toString() { - return String.format( - "DefaultEnvironment (" + "assetAdministrationShells=%s," - + "submodels=%s," - + "conceptDescriptions=%s," - + ")", - this.assetAdministrationShells, this.submodels, this.conceptDescriptions); + @Override + public List getSubmodels() { + return submodels; + } + + @Override + public void setSubmodels(List submodels) { + this.submodels = submodels; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index 49453f922..ff4ffe345 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.EventPayloadBuilder; -import java.util.Arrays; import java.util.Objects; @@ -33,42 +32,44 @@ @IRI("aas:EventPayload") public class DefaultEventPayload implements EventPayload { - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") protected Reference observableSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") - protected byte[] payload; + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") + protected String payload; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") protected Reference subjectId; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") protected String timeStamp; - @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") protected String topic; - public DefaultEventPayload() {} + public DefaultEventPayload() { + + } @Override public int hashCode() { - return Objects.hash(this.source, - this.sourceSemanticId, - this.observableReference, + return Objects.hash(this.observableReference, this.observableSemanticId, - this.topic, + this.payload, + this.source, + this.sourceSemanticId, this.subjectId, this.timeStamp, - Arrays.hashCode(this.payload)); + this.topic); } @Override @@ -81,65 +82,65 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.source, other.source) && - Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && - Objects.equals(this.observableReference, other.observableReference) && + return Objects.equals(this.observableReference, other.observableReference) && Objects.equals(this.observableSemanticId, other.observableSemanticId) && - Objects.equals(this.topic, other.topic) && + Objects.equals(this.payload, other.payload) && + Objects.equals(this.source, other.source) && + Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Arrays.equals(this.payload, other.payload); + Objects.equals(this.topic, other.topic); } } @Override - public Reference getSource() { - return source; + public Reference getObservableReference() { + return observableReference; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSourceSemanticId() { - return sourceSemanticId; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSourceSemanticId(Reference sourceSemanticId) { - this.sourceSemanticId = sourceSemanticId; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getObservableReference() { - return observableReference; + public String getPayload() { + return payload; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setPayload(String payload) { + this.payload = payload; } @Override - public Reference getObservableSemanticId() { - return observableSemanticId; + public Reference getSource() { + return source; } @Override - public void setObservableSemanticId(Reference observableSemanticId) { - this.observableSemanticId = observableSemanticId; + public void setSource(Reference source) { + this.source = source; } @Override - public String getTopic() { - return topic; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override @@ -163,28 +164,13 @@ public void setTimeStamp(String timeStamp) { } @Override - public byte[] getPayload() { - return payload; + public String getTopic() { + return topic; } @Override - public void setPayload(byte[] payload) { - this.payload = payload; - } - - public String toString() { - return String.format( - "DefaultEventPayload (" + "source=%s," - + "sourceSemanticId=%s," - + "observableReference=%s," - + "observableSemanticId=%s," - + "topic=%s," - + "subjectId=%s," - + "timeStamp=%s," - + "payload=%s," - + ")", - this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, - this.timeStamp, this.payload); + public void setTopic(String topic) { + this.topic = topic; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index 60f3a99bf..ffe3224de 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,32 +35,36 @@ @IRI("aas:Extension") public class DefaultExtension implements Extension { - @IRI("https://admin-shell.io/aas/3/0/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") - protected List refersTos = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") + protected Reference refersTo; - @IRI("https://admin-shell.io/aas/3/0/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() {} + public DefaultExtension() { + + this.valueType = DataTypeDefXsd.STRING; + + } @Override public int hashCode() { return Objects.hash(this.name, - this.valueType, + this.refersTo, this.value, - this.refersTos, + this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -76,9 +80,9 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.refersTo, other.refersTo) && Objects.equals(this.value, other.value) && - Objects.equals(this.refersTos, other.refersTos) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -95,13 +99,13 @@ public void setName(String name) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public Reference getRefersTo() { + return refersTo; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setRefersTo(Reference refersTo) { + this.refersTo = refersTo; } @Override @@ -115,13 +119,13 @@ public void setValue(String value) { } @Override - public List getRefersTos() { - return refersTos; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTos(List refersTos) { - this.refersTos = refersTos; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -144,16 +148,6 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } - public String toString() { - return String.format( - "DefaultExtension (" + "name=%s," - + "valueType=%s," - + "value=%s," - + "refersTos=%s," - + ")", - this.name, this.valueType, this.value, this.refersTos); - } - /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 908dbfbb0..543eafd41 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,54 +33,68 @@ @IRI("aas:File") public class DefaultFile implements File { - @IRI("https://admin-shell.io/aas/3/0/File/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/File/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultFile() {} + public DefaultFile() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.value, - this.contentType, + return Objects.hash(this.contentType, + this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -93,38 +107,40 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && + return Objects.equals(this.contentType, other.contentType) && + Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override @@ -158,13 +174,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -178,33 +194,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,12 +243,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultFile (" + "value=%s," - + "contentType=%s," - + ")", - this.value, this.contentType); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index a5be28afe..ad4f10f7f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,13 +32,15 @@ @IRI("aas:Key") public class DefaultKey implements Key { - @IRI("https://admin-shell.io/aas/3/0/Key/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") protected KeyTypes type; - @IRI("https://admin-shell.io/aas/3/0/Key/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") protected String value; - public DefaultKey() {} + public DefaultKey() { + + } @Override public int hashCode() { @@ -81,14 +83,6 @@ public void setValue(String value) { this.value = value; } - public String toString() { - return String.format( - "DefaultKey (" + "type=%s," - + "value=%s," - + ")", - this.type, this.value); - } - /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java new file mode 100644 index 000000000..30b2300cf --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringBuilder; + +import java.util.Objects; + + +@IRI("rdf:langString") +public class DefaultLangString implements LangString { + + protected String language = null; + protected String text = null; + + public DefaultLangString() { + super(); + } + + public DefaultLangString(String textAndLanguage) { + if (textAndLanguage.contains("@")) { + String[] splitString = textAndLanguage.split("@"); + this.text = splitString[0]; + this.language = splitString[1]; + } else { + this.text = textAndLanguage; + } + } + + public DefaultLangString(String text, String language) { + this.text = text; + this.language = language; + } + + @Override + public String getLanguage() { + return language; + } + + @Override + public void setLanguage(String language) { + this.language = language; + } + + @Override + public String getText() { + return text; + } + + @Override + public void setText(String text) { + this.text = text; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultLangString other = (DefaultLangString) obj; + return Objects.equals(this.language, other.language) && Objects.equals(this.text, other.text); + } + } + + @Override + public int hashCode() { + return Objects.hash(this.language, this.text); + } + + @Override + public String toString() { + String result = this.text; + if (this.language != null && !this.language.isEmpty()) { + return "\"" + result + "\"@" + this.language; + } + return result; + } + + /** + * This builder class can be used to construct a DefaultLangString bean. + */ + public static class Builder extends LangStringBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultLangString newBuildingInstance() { + return new DefaultLangString(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 27bf73690..0bdc7638a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,54 +33,68 @@ @IRI("aas:MultiLanguageProperty") public class DefaultMultiLanguageProperty implements MultiLanguageProperty { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() {} + public DefaultMultiLanguageProperty() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.values, + return Objects.hash(this.value, this.valueId, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -93,28 +107,30 @@ public boolean equals(Object obj) { return false; } else { DefaultMultiLanguageProperty other = (DefaultMultiLanguageProperty) obj; - return Objects.equals(this.values, other.values) && + return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public List getValues() { - return values; + public List getValue() { + return value; } @Override - public void setValues(List values) { - this.values = values; + public void setValue(List value) { + this.value = value; } @Override @@ -158,13 +174,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -178,33 +194,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -217,12 +243,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultMultiLanguageProperty (" + "values=%s," - + "valueId=%s," - + ")", - this.values, this.valueId); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index b4f359f66..fe8d5e818 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,70 @@ @IRI("aas:Operation") public class DefaultOperation implements Operation { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") protected List inoutputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") protected List inputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") protected List outputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultOperation() {} + public DefaultOperation() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.inputVariables, + return Objects.hash(this.inoutputVariables, + this.inputVariables, this.outputVariables, - this.inoutputVariables, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,21 +109,33 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inoutputVariables, other.inoutputVariables) && + Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && - Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getInputVariables() { return inputVariables; @@ -132,16 +156,6 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -173,13 +187,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +207,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +256,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultOperation (" + "inputVariables=%s," - + "outputVariables=%s," - + "inoutputVariables=%s," - + ")", - this.inputVariables, this.outputVariables, this.inoutputVariables); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index 5d30e0263..a559f8ac1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,7 +33,7 @@ @IRI("aas:OperationVariable") public class DefaultOperationVariable implements OperationVariable { - @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") protected SubmodelElement value; public DefaultOperationVariable() {} @@ -67,13 +67,6 @@ public void setValue(SubmodelElement value) { this.value = value; } - public String toString() { - return String.format( - "DefaultOperationVariable (" + "value=%s," - + ")", - this.value); - } - /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 273ac55b9..a83c00054 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,72 @@ @IRI("aas:Property") public class DefaultProperty implements Property { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Property/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultProperty() {} + public DefaultProperty() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.valueType, - this.value, + return Objects.hash(this.value, this.valueId, + this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,31 +111,23 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public String getValue() { return value; @@ -142,6 +148,16 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -173,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultProperty (" + "valueType=%s," - + "value=%s," - + "valueId=%s," - + ")", - this.valueType, this.value, this.valueId); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java new file mode 100644 index 000000000..4f2d99fb2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; + +import java.util.Objects; + +@IRI("aas:ProtocolInformation") +public class DefaultProtocolInformation implements ProtocolInformation { + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") + protected String endpointAddress; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + protected String endpointProtocol; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") + protected String endpointProtocolVersion; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + protected String subprotocol; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + protected String subprotocolBody; + + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + protected String subprotocolBodyEncoding; + + public DefaultProtocolInformation() { + } + + @Override + public int hashCode() { + return Objects.hash(this.endpointAddress, + this.endpointProtocol, + this.endpointProtocolVersion, + this.subprotocol, + this.subprotocolBody, + this.subprotocolBodyEncoding); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultProtocolInformation other = (DefaultProtocolInformation) obj; + return Objects.equals(this.endpointAddress, other.endpointAddress) && + Objects.equals(this.endpointProtocol, other.endpointProtocol) && + Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && + Objects.equals(this.subprotocol, other.subprotocol) && + Objects.equals(this.subprotocolBody, other.subprotocolBody) && + Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding); + } + } + + @Override + public String getEndpointAddress() { + return endpointAddress; + } + + @Override + public void setEndpointAddress(String endpointAddress) { + this.endpointAddress = endpointAddress; + } + + @Override + public String getEndpointProtocol() { + return endpointProtocol; + } + + @Override + public void setEndpointProtocol(String endpointProtocol) { + this.endpointProtocol = endpointProtocol; + } + + @Override + public String getEndpointProtocolVersion() { + return endpointProtocolVersion; + } + + @Override + public void setEndpointProtocolVersion(String endpointProtocolVersion) { + this.endpointProtocolVersion = endpointProtocolVersion; + } + + @Override + public String getSubprotocol() { + return subprotocol; + } + + @Override + public void setSubprotocol(String subprotocol) { + this.subprotocol = subprotocol; + } + + @Override + public String getSubprotocolBody() { + return subprotocolBody; + } + + @Override + public void setSubprotocolBody(String subprotocolBody) { + this.subprotocolBody = subprotocolBody; + } + + @Override + public String getSubprotocolBodyEncoding() { + return subprotocolBodyEncoding; + } + + @Override + public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { + this.subprotocolBodyEncoding = subprotocolBodyEncoding; + } + + /** + * This builder class can be used to construct a DefaultProtocolInformation bean. + */ + public static class Builder extends ProtocolInformationBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultProtocolInformation newBuildingInstance() { + return new DefaultProtocolInformation(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 2bb2a7182..659a522bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,36 +37,39 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") protected QualifierKind kind; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") protected String type; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") protected DataTypeDefXsd valueType; - public DefaultQualifier() {} + public DefaultQualifier() { + this.kind = QualifierKind.CONCEPT_QUALIFIER; + + } @Override public int hashCode() { return Objects.hash(this.kind, this.type, - this.valueType, this.value, this.valueId, + this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -83,9 +86,9 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -111,16 +114,6 @@ public void setType(String type) { this.type = type; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public String getValue() { return value; @@ -141,6 +134,16 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public Reference getSemanticId() { return semanticId; @@ -161,17 +164,6 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } - public String toString() { - return String.format( - "DefaultQualifier (" + "kind=%s," - + "type=%s," - + "valueType=%s," - + "value=%s," - + "valueId=%s," - + ")", - this.kind, this.type, this.valueType, this.value, this.valueId); - } - /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 1e80d3426..1b1b12f53 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,72 @@ @IRI("aas:Range") public class DefaultRange implements Range { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Range/max") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") protected String max; - @IRI("https://admin-shell.io/aas/3/0/Range/min") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") protected String min; - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - public DefaultRange() {} + public DefaultRange() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.valueType, + return Objects.hash(this.max, this.min, - this.max, + this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -97,29 +111,31 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.valueType, other.valueType) && + return Objects.equals(this.max, other.max) && Objects.equals(this.min, other.min) && - Objects.equals(this.max, other.max) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -133,13 +149,13 @@ public void setMin(String min) { } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -173,13 +189,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -193,33 +209,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,13 +258,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultRange (" + "valueType=%s," - + "min=%s," - + "max=%s," - + ")", - this.valueType, this.min, this.max); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index 79d0f7a68..be3e718f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,22 +35,24 @@ @IRI("aas:Reference") public class DefaultReference implements Reference { - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") protected Reference referredSemanticId; - @IRI("https://admin-shell.io/aas/3/0/Reference/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") protected ReferenceTypes type; - public DefaultReference() {} + public DefaultReference() { + + } @Override public int hashCode() { - return Objects.hash(this.type, + return Objects.hash(this.keys, this.referredSemanticId, - this.keys); + this.type); } @Override @@ -63,20 +65,20 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.type, other.type) && + return Objects.equals(this.keys, other.keys) && Objects.equals(this.referredSemanticId, other.referredSemanticId) && - Objects.equals(this.keys, other.keys); + Objects.equals(this.type, other.type); } } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; } @Override @@ -90,22 +92,13 @@ public void setReferredSemanticId(Reference referredSemanticId) { } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; - } - - public String toString() { - return String.format( - "DefaultReference (" + "type=%s," - + "referredSemanticId=%s," - + "keys=%s," - + ")", - this.type, this.referredSemanticId, this.keys); + public void setType(ReferenceTypes type) { + this.type = type; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 032121dd0..23c2f26da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,37 +34,49 @@ @IRI("aas:ReferenceElement") public class DefaultReferenceElement implements ReferenceElement { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() {} + public DefaultReferenceElement() { + + this.category = "VARIABLE"; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -72,12 +84,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -94,12 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -144,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -164,33 +180,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public List getDisplayNames() { - return displayNames; + public List getDescription() { + return description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public List getDescriptions() { - return descriptions; + public List getDisplayName() { + return displayName; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -203,11 +229,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultReferenceElement (" + "value=%s," - + ")", - this.value); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index df41bf9e7..99361ba3c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,40 +34,50 @@ @IRI("aas:RelationshipElement") public class DefaultRelationshipElement implements RelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() {} + public DefaultRelationshipElement() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { @@ -76,12 +86,14 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -99,12 +111,14 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -179,33 +193,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -218,12 +242,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultRelationshipElement (" + "first=%s," - + "second=%s," - + ")", - this.first, this.second); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index fa28ac29e..ae673a6b6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,18 +32,20 @@ @IRI("aas:Resource") public class DefaultResource implements Resource { - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/Resource/path") + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") protected String path; - public DefaultResource() {} + public DefaultResource() { + + } @Override public int hashCode() { - return Objects.hash(this.path, - this.contentType); + return Objects.hash(this.contentType, + this.path); } @Override @@ -56,21 +58,11 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.path, other.path) && - Objects.equals(this.contentType, other.contentType); + return Objects.equals(this.contentType, other.contentType) && + Objects.equals(this.path, other.path); } } - @Override - public String getPath() { - return path; - } - - @Override - public void setPath(String path) { - this.path = path; - } - @Override public String getContentType() { return contentType; @@ -81,12 +73,14 @@ public void setContentType(String contentType) { this.contentType = contentType; } - public String toString() { - return String.format( - "DefaultResource (" + "path=%s," - + "contentType=%s," - + ")", - this.path, this.contentType); + @Override + public String getPath() { + return path; + } + + @Override + public void setPath(String path) { + this.path = path; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java new file mode 100644 index 000000000..a7ecb4299 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SpecificAssetIdBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId + * + * A specific asset ID describes a generic supplementary identifying attribute of the asset. + */ + +@IRI("aas:SpecificAssetId") +public class DefaultSpecificAssetId implements SpecificAssetId { + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + protected Reference externalSubjectId; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + protected String name; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + protected String value; + + public DefaultSpecificAssetId() { + + } + + @Override + public int hashCode() { + return Objects.hash(this.externalSubjectId, + this.name, + this.value, + this.semanticId, + this.supplementalSemanticIds); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSpecificAssetId other = (DefaultSpecificAssetId) obj; + return Objects.equals(this.externalSubjectId, other.externalSubjectId) && + Objects.equals(this.name, other.name) && + Objects.equals(this.value, other.value) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); + } + } + + @Override + public Reference getExternalSubjectId() { + return externalSubjectId; + } + + @Override + public void setExternalSubjectId(Reference externalSubjectId) { + this.externalSubjectId = externalSubjectId; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + /** + * This builder class can be used to construct a DefaultSpecificAssetId bean. + */ + public static class Builder extends SpecificAssetIdBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSpecificAssetId newBuildingInstance() { + return new DefaultSpecificAssetId(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 5ae55c885..a1e816feb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,61 +33,69 @@ @IRI("aas:Submodel") public class DefaultSubmodel implements Submodel { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") - protected ModellingKind kind; + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() {} + public DefaultSubmodel() { + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, - this.kind, - this.semanticId, - this.supplementalSemanticIds, this.administration, this.id, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.kind, this.qualifiers); } @@ -103,16 +111,17 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -138,63 +147,63 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public ModellingKind getKind() { - return kind; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setKind(ModellingKind kind) { - this.kind = kind; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public Reference getSemanticId() { - return semanticId; + public String getId() { + return id; } @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; + public void setId(String id) { + this.id = id; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public String getCategory() { + return category; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setCategory(String category) { + this.category = category; } @Override - public AdministrativeInformation getAdministration() { - return administration; + public String getChecksum() { + return checksum; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setChecksum(String checksum) { + this.checksum = checksum; } @Override - public String getId() { - return id; + public List getDescription() { + return description; } @Override - public void setId(String id) { - this.id = id; + public void setDescription(List description) { + this.description = description; } @Override - public String getCategory() { - return category; + public List getDisplayName() { + return displayName; } @Override - public void setCategory(String category) { - this.category = category; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override @@ -208,33 +217,43 @@ public void setIdShort(String idShort) { } @Override - public List getDisplayNames() { - return displayNames; + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public List getDescriptions() { - return descriptions; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public List getExtensions() { - return extensions; + public ModelingKind getKind() { + return kind; } @Override - public void setExtensions(List extensions) { - this.extensions = extensions; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -247,13 +266,6 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } - public String toString() { - return String.format( - "DefaultSubmodel (" + "submodelElements=%s," - + ")", - this.submodelElements); - } - /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java new file mode 100644 index 000000000..580519f78 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelDescriptorBuilder; + +@IRI("aas:SubmodelDescriptor") +public class DefaultSubmodelDescriptor implements SubmodelDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") + protected List description; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") + protected List displayName; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + protected String identification; + + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + protected Reference semanticId; + + public DefaultSubmodelDescriptor() { + } + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.description, + this.displayName, + this.idShort, + this.identification, + this.semanticId, + this.endpoints); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelDescriptor other = (DefaultSubmodelDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.identification, other.identification) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.endpoints, other.endpoints); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getIdentification() { + return identification; + } + + @Override + public void setIdentification(String identification) { + this.identification = identification; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + /** + * This builder class can be used to construct a DefaultSubmodelDescriptor bean. + */ + public static class Builder extends SubmodelDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelDescriptor newBuildingInstance() { + return new DefaultSubmodelDescriptor(); + } + } +} From 534bbec4acef754977aabb49f9687c25d5f3063f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 30 Jun 2023 10:07:59 +0200 Subject: [PATCH 10/91] Update model project --- .../digitaltwin/aas4j/v3/model/Key.java | 16 +- .../digitaltwin/aas4j/v3/model/KeyTypes.java | 52 +++--- .../aas4j/v3/model/LangString.java | 33 ++++ .../digitaltwin/aas4j/v3/model/LevelType.java | 107 +++---------- .../{ModellingKind.java => ModelingKind.java} | 18 +-- .../aas4j/v3/model/MultiLanguageProperty.java | 24 +-- .../digitaltwin/aas4j/v3/model/Operation.java | 54 +++---- .../aas4j/v3/model/OperationVariable.java | 10 +- .../digitaltwin/aas4j/v3/model/Property.java | 54 +++---- .../aas4j/v3/model/ProtocolInformation.java | 135 ++++++++++++++++ .../aas4j/v3/model/Qualifiable.java | 10 +- .../digitaltwin/aas4j/v3/model/Qualifier.java | 66 ++++---- .../aas4j/v3/model/QualifierKind.java | 10 +- .../digitaltwin/aas4j/v3/model/Range.java | 46 +++--- .../digitaltwin/aas4j/v3/model/Referable.java | 89 +++++++---- .../digitaltwin/aas4j/v3/model/Reference.java | 46 +++--- .../aas4j/v3/model/ReferenceElement.java | 10 +- .../aas4j/v3/model/ReferenceTypes.java | 16 +- .../aas4j/v3/model/RelationshipElement.java | 16 +- .../digitaltwin/aas4j/v3/model/Resource.java | 40 ++--- .../aas4j/v3/model/SpecificAssetId.java | 89 +++++++++++ .../aas4j/v3/model/StateOfEvent.java | 8 +- .../digitaltwin/aas4j/v3/model/Submodel.java | 12 +- .../aas4j/v3/model/SubmodelDescriptor.java | 133 ++++++++++++++++ .../aas4j/v3/model/SubmodelElement.java | 10 +- .../v3/model/SubmodelElementCollection.java | 20 +-- .../aas4j/v3/model/SubmodelElementList.java | 64 ++++---- .../digitaltwin/aas4j/v3/model/ValueList.java | 10 +- .../aas4j/v3/model/ValueReferencePair.java | 20 +-- .../DefaultSubmodelElementCollection.java | 130 +++++++++------ .../impl/DefaultSubmodelElementList.java | 150 ++++++++++-------- .../aas4j/v3/model/impl/DefaultValueList.java | 13 +- .../model/impl/DefaultValueReferencePair.java | 20 +-- 33 files changed, 962 insertions(+), 569 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java rename model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/{ModellingKind.java => ModelingKind.java} (64%) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index c91f83277..80ead008c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface Key { /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/Key/type + * More information under https://admin-shell.io/aas/3/0/RC02/Key/type * * @return Returns the KeyTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Key/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") KeyTypes getType(); /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/Key/type + * More information under https://admin-shell.io/aas/3/0/RC02/Key/type * * @param type desired value for the property type. */ @@ -51,17 +51,17 @@ public interface Key { /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/Key/value + * More information under https://admin-shell.io/aas/3/0/RC02/Key/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Key/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") String getValue(); /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/Key/value + * More information under https://admin-shell.io/aas/3/0/RC02/Key/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index fd44ac144..5e6cec41e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,133 +28,133 @@ public enum KeyTypes { /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AssetAdministrationShell") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AssetAdministrationShell") ASSET_ADMINISTRATION_SHELL, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Capability") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ConceptDescription") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ConceptDescription") CONCEPT_DESCRIPTION, /** * Data element. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/DataElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Entity") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Entity") ENTITY, /** * Event. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/EventElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/File") FILE, /** * Bookmark or a similar local identifier of a subordinate part of a primary resource */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/FragmentReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/FragmentReference") FRAGMENT_REFERENCE, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/GlobalReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/GlobalReference") GLOBAL_REFERENCE, /** * Identifiable. */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Identifiable") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Identifiable") IDENTIFIABLE, /** * Property with a value that can be provided in multiple languages */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Operation") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Property") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Property") PROPERTY, /** * Range with min and max */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Range") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Referable") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Referable") REFERABLE, /** * Reference */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ReferenceElement") REFERENCE_ELEMENT, /** * Relationship */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Submodel") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Submodel") SUBMODEL, /** * Submodel Element */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElement") SUBMODEL_ELEMENT, /** * Struct of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** * List of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java new file mode 100644 index 000000000..9d374c663 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + +import java.io.Serializable; + + +@IRI("rdf:langString") +public interface LangString extends Serializable { + + public String getLanguage(); + + public void setLanguage(String language); + + public String getText(); + + public void setText(String text); +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index df6a1ac15..e3ab34e5f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -16,94 +16,33 @@ package org.eclipse.digitaltwin.aas4j.v3.model; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; - -/** - * Value represented by up to four variants of a numeric value in a specific role: MIN, NOM, TYP and - * MAX. True means that the value is available, false means the value is not available. - */ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultLevelType.class) -}) -public interface LevelType { - - /** - * Minimum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/min - * - * @return Returns the boolean for the property min. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/min") - boolean getMin(); - - /** - * Minimum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/min - * - * @param min desired value for the property min. - */ - void setMin(boolean min); +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - /** - * Nominal value (value as designated) - * - * More information under https://admin-shell.io/aas/3/0/LevelType/nom - * - * @return Returns the boolean for the property nom. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/nom") - boolean getNom(); - /** - * Nominal value (value as designated) - * - * More information under https://admin-shell.io/aas/3/0/LevelType/nom - * - * @param nom desired value for the property nom. - */ - void setNom(boolean nom); +/** +*/ +@IRI("aas:LevelType") +public enum LevelType { - /** - * Value as typically present - * - * More information under https://admin-shell.io/aas/3/0/LevelType/typ - * - * @return Returns the boolean for the property typ. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") - boolean getTyp(); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Max") + MAX, - /** - * Value as typically present - * - * More information under https://admin-shell.io/aas/3/0/LevelType/typ - * - * @param typ desired value for the property typ. - */ - void setTyp(boolean typ); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Min") + MIN, - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @return Returns the boolean for the property max. - */ - @IRI("https://admin-shell.io/aas/3/0/LevelType/max") - boolean getMax(); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Nom") + NOM, - /** - * Maximum of the value - * - * More information under https://admin-shell.io/aas/3/0/LevelType/max - * - * @param max desired value for the property max. - */ - void setMax(boolean max); + /** + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Typ") + TYP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java similarity index 64% rename from model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java rename to model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java index 50aba3530..a0e26f775 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,21 +23,19 @@ /** * Enumeration for denoting whether an element is a template or an instance. */ -@IRI("aas:ModellingKind") -public enum ModellingKind { +@IRI("aas:ModelingKind") +public enum ModelingKind { /** - * Concrete, clearly identifiable element instance. Its creation and validation may be guided by a - * corresponding element template. + * Concrete, clearly identifiable component of a certain template. */ - @IRI("https://admin-shell.io/aas/3/0/ModellingKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Instance") INSTANCE, /** - * Specification of the common features of a structured element in sufficient detail that such a - * instance can be instantiated using it + * Software element which specifies the common attributes shared by all instances of the template. */ - @IRI("https://admin-shell.io/aas/3/0/ModellingKind/Template") + @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Template") TEMPLATE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index d828bec39..3ab965e2d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,36 +33,36 @@ public interface MultiLanguageProperty extends DataElement { /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value * - * @return Returns the List of LangStringTextTypes for the property values. + * @return Returns the List of LangStrings for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + List getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value * - * @param values desired value for the property values. + * @param value desired value for the property value. */ - void setValues(List values); + void setValue(List value); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 17a2ea927..4ba439e71 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,20 +30,39 @@ }) public interface Operation extends SubmodelElement { + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables * * @return Returns the List of OperationVariables for the property inputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") List getInputVariables(); /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables * * @param inputVariables desired value for the property inputVariables. */ @@ -52,39 +71,20 @@ public interface Operation extends SubmodelElement { /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables * * @return Returns the List of OperationVariables for the property outputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") List getOutputVariables(); /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables * * @param outputVariables desired value for the property outputVariables. */ void setOutputVariables(List outputVariables); - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index d62fa0440..2975e42e9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface OperationVariable { /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value * * @return Returns the SubmodelElement for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") SubmodelElement getValue(); /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index 7df12e7ef..b937792da 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,39 +29,20 @@ }) public interface Property extends DataElement { - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/Property/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/Property/value + * More information under https://admin-shell.io/aas/3/0/RC02/Property/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Property/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") String getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/Property/value + * More information under https://admin-shell.io/aas/3/0/RC02/Property/value * * @param value desired value for the property value. */ @@ -70,20 +51,39 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Property/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java new file mode 100644 index 000000000..8b4527f69 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultProtocolInformation.class) +}) +public interface ProtocolInformation { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * + * @return Returns the String for the property endpointAddress. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") + String getEndpointAddress(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * + * @param endpointAddress desired value for the property endpointAddress. + */ + void setEndpointAddress(String endpointAddress); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * + * @return Returns the String for the property endpointProtocol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + String getEndpointProtocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * + * @param endpointProtocol desired value for the property endpointProtocol. + */ + void setEndpointProtocol(String endpointProtocol); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * + * @return Returns the String for the property endpointProtocolVersion. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") + String getEndpointProtocolVersion(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * + * @param endpointProtocolVersion desired value for the property endpointProtocolVersion. + */ + void setEndpointProtocolVersion(String endpointProtocolVersion); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * + * @return Returns the String for the property subprotocol. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + String getSubprotocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * + * @param subprotocol desired value for the property subprotocol. + */ + void setSubprotocol(String subprotocol); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * + * @return Returns the String for the property subprotocolBody. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + String getSubprotocolBody(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * + * @param subprotocolBody desired value for the property subprotocolBody. + */ + void setSubprotocolBody(String subprotocolBody); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * + * @return Returns the String for the property subprotocolBodyEncoding. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + String getSubprotocolBodyEncoding(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value for the property subprotocolBodyEncoding. + */ + void setSubprotocolBodyEncoding(String subprotocolBodyEncoding); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index da02ca695..6e4389d84 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifiable { /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers * * @return Returns the List of Qualifiers for the property qualifiers. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") List getQualifiers(); /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers * * @param qualifiers desired value for the property qualifiers. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index 624d79ff3..3f2063d97 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifier extends HasSemantics { /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind * * @return Returns the QualifierKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") QualifierKind getKind(); /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind * * @param kind desired value for the property kind. */ @@ -52,55 +52,36 @@ public interface Qualifier extends HasSemantics { /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type * * @return Returns the String for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") String getType(); /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type * * @param type desired value for the property type. */ void setType(String type); - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") String getValue(); /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value * * @param value desired value for the property value. */ @@ -109,20 +90,39 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 844a14308..3919791a2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,19 +29,19 @@ public enum QualifierKind { /** * qualifies the semantic definition the element is referring to ('semanticId') */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, /** * qualifies the elements within a specific submodel on concept level. */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/TemplateQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/TemplateQualifier") TEMPLATE_QUALIFIER, /** * qualifies the value of the element and can change during run-time. */ - @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ValueQualifier") + @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ValueQualifier") VALUE_QUALIFIER; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index 1ff17790c..26b1b0c6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,60 +30,60 @@ public interface Range extends DataElement { /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Range/max * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/Range/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/valueType + * More information under https://admin-shell.io/aas/3/0/RC02/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXsd valueType); + void setMax(String max); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/min + * More information under https://admin-shell.io/aas/3/0/RC02/Range/min * * @return Returns the String for the property min. */ - @IRI("https://admin-shell.io/aas/3/0/Range/min") + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") String getMin(); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/Range/min + * More information under https://admin-shell.io/aas/3/0/RC02/Range/min * * @param min desired value for the property min. */ void setMin(String min); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/Range/max + * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index f85391a54..87346d826 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), - @KnownSubtypes.Type(value = Identifiable.class) + @KnownSubtypes.Type(value = Identifiable.class), + @KnownSubtypes.Type(value = SubmodelElement.class) }) public interface Referable extends HasExtensions { @@ -34,80 +34,101 @@ public interface Referable extends HasExtensions { * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/Referable/category + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category * * @return Returns the String for the property category. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") String getCategory(); /** * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/Referable/category + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category * * @param category desired value for the property category. */ void setCategory(String category); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Checksum to be used to determine if an Referable (including its aggregated child elements) has + * changed. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum * - * @return Returns the String for the property idShort. + * @return Returns the String for the property checksum. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + String getChecksum(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Checksum to be used to determine if an Referable (including its aggregated child elements) has + * changed. * - * More information under https://admin-shell.io/aas/3/0/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum * - * @param idShort desired value for the property idShort. + * @param checksum desired value for the property checksum. */ - void setIdShort(String idShort); + void setChecksum(String checksum); + + /** + * Description or comments on the element. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * + * @return Returns the List of LangStrings for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + List getDescription(); + + /** + * Description or comments on the element. + * + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName * - * @return Returns the List of LangStringNameTypes for the property displayNames. + * @return Returns the List of LangStrings for the property displayName. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - List getDisplayNames(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + List getDisplayName(); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName * - * @param displayNames desired value for the property displayNames. + * @param displayName desired value for the property displayName. */ - void setDisplayNames(List displayNames); + void setDisplayName(List displayName); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort * - * @return Returns the List of LangStringTextTypes for the property descriptions. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - List getDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/Referable/description + * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort * - * @param descriptions desired value for the property descriptions. + * @param idShort desired value for the property idShort. */ - void setDescriptions(List descriptions); + void setIdShort(String idShort); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index 2aa779da6..8575d95e8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,60 +31,60 @@ public interface Reference { /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/Reference/type + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId * * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") Reference getReferredSemanticId(); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId * * @param referredSemanticId desired value for the property referredSemanticId. */ void setReferredSemanticId(Reference referredSemanticId); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/Reference/keys + * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index 95fe8bd7e..cd13ceb32 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface ReferenceElement extends DataElement { * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value * * @return Returns the Reference for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") Reference getValue(); /** * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 305a50ee9..fa65393f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,21 +21,21 @@ /** - * Reference types + * ReferenceTypes */ @IRI("aas:ReferenceTypes") public enum ReferenceTypes { /** - * External reference. + * GlobalReference. */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ExternalReference") - EXTERNAL_REFERENCE, + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/GlobalReference") + GLOBAL_REFERENCE, /** - * Model reference. + * ModelReference */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ModelReference") + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ModelReference") MODEL_REFERENCE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index 4caefc472..e2ffe5b1d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first * * @return Returns the Reference for the property first. */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") Reference getFirst(); /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first * * @param first desired value for the property first. */ @@ -53,17 +53,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second * * @return Returns the Reference for the property second. */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") Reference getSecond(); /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second * * @param second desired value for the property second. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index 5c01c0149..ac9f59ae6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Resource { /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/Resource/path + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java new file mode 100644 index 000000000..6c54d5d28 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; + + +/** + * A specific asset ID describes a generic supplementary identifying attribute of the asset. + */ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSpecificAssetId.class) +}) +public interface SpecificAssetId extends HasSemantics { + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId + * + * @return Returns the Reference for the property externalSubjectId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId + * + * @param externalSubjectId desired value for the property externalSubjectId. + */ + void setExternalSubjectId(Reference externalSubjectId); + + /** + * Name of the identifier + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * + * @return Returns the String for the property name. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + String getName(); + + /** + * Name of the identifier + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * + * @param name desired value for the property name. + */ + void setName(String name); + + /** + * The value of the specific asset identifier with the corresponding name. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + String getValue(); + + /** + * The value of the specific asset identifier with the corresponding name. + * + * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index c976edd7a..a52edcf60 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum StateOfEvent { /** * Event is off. */ - @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/Off") + @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/Off") OFF, /** * Event is on */ - @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/On") + @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/On") ON; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index eeffb4150..12789fff0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,22 +28,22 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { +public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements * * @return Returns the List of SubmodelElements for the property submodelElements. */ - @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") List getSubmodelElements(); /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements * * @param submodelElements desired value for the property submodelElements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java new file mode 100644 index 000000000..83a51cfb4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; + +import java.util.List; + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelDescriptor.class) +}) +public interface SubmodelDescriptor extends Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * + * @return Returns the LangStringSet for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * + * @param description desired value for the property description. + */ + void setDescription(List description); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName + * + * @return Returns the LangStringSet for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName + * + * @param displayName desired value for the property displayName. + */ + void setDisplayName(List displayName); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @return Returns the String for the property identification. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") + String getIdentification(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * + * @param identification desired value for the property identification. + */ + void setIdentification(String identification); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * + * @return Returns the Reference for the property semanticId. + */ + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + Reference getSemanticId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * + * @param semanticId desired value for the property semanticId. + */ + void setSemanticId(Reference semanticId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index c18a4f6bb..d864c6344 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, HasKind, Referable, Qualifiable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index 67c357f26..7a913462d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.List; +import java.util.Collection; /** @@ -34,20 +34,20 @@ public interface SubmodelElementCollection extends SubmodelElement { /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value * - * @return Returns the List of SubmodelElements for the property values. + * @return Returns the Collection of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + Collection getValue(); /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value * - * @param values desired value for the property values. + * @param value desired value for the property value. */ - void setValues(List values); + void setValue(Collection value); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index 7d5895e6e..34d62ee6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface SubmodelElementList extends SubmodelElement { * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant * * @return Returns the boolean for the property orderRelevant. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") boolean getOrderRelevant(); /** * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant * * @param orderRelevant desired value for the property orderRelevant. */ @@ -54,17 +54,19 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement * * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement * * @param semanticIdListElement desired value for the property semanticIdListElement. */ @@ -73,58 +75,62 @@ public interface SubmodelElementList extends SubmodelElement { /** * The submodel element type of the submodel elements contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement * * @return Returns the AasSubmodelElements for the property typeValueListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement * * @param typeValueListElement desired value for the property typeValueListElement. */ void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value * - * @return Returns the DataTypeDefXsd for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + List getValue(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param value desired value for the property value. */ - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValue(List value); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property values. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - List getValues(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value + * More information under + * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement * - * @param values desired value for the property values. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValues(List values); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index d5e66885c..cc89c5dcc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface ValueList { /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs * * @return Returns the List of ValueReferencePairs for the property valueReferencePairs. */ - @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") List getValueReferencePairs(); /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs * * @param valueReferencePairs desired value for the property valueReferencePairs. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 426ff7b51..3f6b6dcf2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,19 +31,19 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in 'valueId'. + * The value of the referenced concept definition of the value in valueId. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") String getValue(); /** - * The value of the referenced concept definition of the value in 'valueId'. + * The value of the referenced concept definition of the value in valueId. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value * * @param value desired value for the property value. */ @@ -52,17 +52,17 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index e321cce9a..5713fbe6b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Objects; @@ -35,50 +36,62 @@ @IRI("aas:SubmodelElementCollection") public class DefaultSubmodelElementCollection implements SubmodelElementCollection { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") + protected Collection value = new ArrayList<>(); + + public DefaultSubmodelElementCollection() { - public DefaultSubmodelElementCollection() {} + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { - return Objects.hash(this.values, + return Objects.hash(this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -91,27 +104,29 @@ public boolean equals(Object obj) { return false; } else { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; - return Objects.equals(this.values, other.values) && + return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @Override - public List getValues() { - return values; + public Collection getValue() { + return value; } @Override - public void setValues(List values) { - this.values = values; + public void setValue(Collection value) { + this.value = value; } @Override @@ -145,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -165,33 +180,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List description) { + this.description = description; } @Override - public List getDisplayNames() { - return displayNames; + public List getDisplayName() { + return displayName; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public void setDisplayName(List displayName) { + this.displayName = displayName; } @Override - public List getDescriptions() { - return descriptions; + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -204,11 +229,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultSubmodelElementCollection (" + "values=%s," - + ")", - this.values); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index bf6140f48..d81d64b4d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,66 +33,79 @@ @IRI("aas:SubmodelElementList") public class DefaultSubmodelElementList implements SubmodelElementList { - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") + protected ModelingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List descriptions = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") + protected String checksum; + + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayNames = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") protected Reference semanticIdListElement; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") protected AasSubmodelElements typeValueListElement; - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") - protected List values = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() {} + public DefaultSubmodelElementList() { + this.orderRelevant = Boolean.TRUE; + + this.kind = ModelingKind.INSTANCE; + + } @Override public int hashCode() { return Objects.hash(this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, + this.value, this.valueTypeListElement, - this.values, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.qualifiers, + this.kind, this.category, + this.checksum, + this.description, + this.displayName, this.idShort, - this.displayNames, - this.descriptions, - this.extensions); + this.extensions, + this.qualifiers); } @Override @@ -108,17 +121,19 @@ public boolean equals(Object obj) { return Objects.equals(this.orderRelevant, other.orderRelevant) && Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && + Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && - Objects.equals(this.values, other.values) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind) && Objects.equals(this.category, other.category) && + Objects.equals(this.checksum, other.checksum) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayNames, other.displayNames) && - Objects.equals(this.descriptions, other.descriptions) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -153,23 +168,23 @@ public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { } @Override - public DataTypeDefXsd getValueTypeListElement() { - return valueTypeListElement; + public List getValue() { + return value; } @Override - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValue(List value) { + this.value = value; } @Override - public List getValues() { - return values; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValues(List values) { - this.values = values; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override @@ -203,13 +218,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public List getQualifiers() { - return qualifiers; + public ModelingKind getKind() { + return kind; } @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public void setKind(ModelingKind kind) { + this.kind = kind; } @Override @@ -223,33 +238,43 @@ public void setCategory(String category) { } @Override - public String getIdShort() { - return idShort; + public String getChecksum() { + return checksum; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setChecksum(String checksum) { + this.checksum = checksum; + } + + @Override + public List getDescription() { + return description; } @Override - public List getDisplayNames() { - return displayNames; + public void setDescription(List description) { + this.description = description; } @Override - public void setDisplayNames(List displayNames) { - this.displayNames = displayNames; + public List getDisplayName() { + return displayName; } @Override - public List getDescriptions() { - return descriptions; + public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + public String getIdShort() { + return idShort; } @Override - public void setDescriptions(List descriptions) { - this.descriptions = descriptions; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -262,15 +287,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - public String toString() { - return String.format( - "DefaultSubmodelElementList (" + "orderRelevant=%s," - + "semanticIdListElement=%s," - + "typeValueListElement=%s," - + "valueTypeListElement=%s," - + "values=%s," - + ")", - this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.values); + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index be8669adf..d9a5cba53 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,7 +34,7 @@ @IRI("aas:ValueList") public class DefaultValueList implements ValueList { - @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") protected List valueReferencePairs = new ArrayList<>(); public DefaultValueList() {} @@ -68,13 +68,6 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } - public String toString() { - return String.format( - "DefaultValueList (" + "valueReferencePairs=%s," - + ")", - this.valueReferencePairs); - } - /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index 7464601a0..af589cd39 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,13 +33,15 @@ @IRI("aas:ValueReferencePair") public class DefaultValueReferencePair implements ValueReferencePair { - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") protected Reference valueId; - public DefaultValueReferencePair() {} + public DefaultValueReferencePair() { + + } @Override public int hashCode() { @@ -82,14 +84,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - public String toString() { - return String.format( - "DefaultValueReferencePair (" + "value=%s," - + "valueId=%s," - + ")", - this.value, this.valueId); - } - /** * This builder class can be used to construct a DefaultValueReferencePair bean. */ From 78c8cc373f4a460b396032bf63d3aa277143ee53 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 14:24:15 +0200 Subject: [PATCH 11/91] Revert the changed files Revert the changed files --- .../v3/dataformat/aasx/AASXDeserializer.java | 26 +- .../v3/dataformat/aasx/AASXSerializer.java | 75 +- .../deserialization/AASXDeserializerTest.java | 8 +- .../aasx/deserialization/ValidationTest.java | 16 +- .../serialization/AASXSerializerTest.java | 17 +- .../src/test/resources/jsonExample.json | 2 +- .../dataformat/DeserializationException.java | 2 +- .../v3/dataformat/SerializationException.java | 2 +- .../deserialization/EnumDeserializer.java | 29 +- .../core/serialization/EnumSerializer.java | 68 +- .../v3/dataformat/core/util/AasUtils.java | 452 +--- .../aas4j/v3/dataformat/core/AASFull.java | 840 +++--- .../aas4j/v3/dataformat/core/AASSimple.java | 185 +- .../v3/dataformat/core/CustomProperty.java | 47 +- .../dataformat/core/EnumDeserializerTest.java | 72 +- .../dataformat/core/EnumSerializerTest.java | 73 +- .../aas4j/v3/model/TypedProperty.java | 2 - dataformat-json/pom.xml | 4 +- .../v3/dataformat/json/JsonDeserializer.java | 336 ++- .../v3/dataformat/json/JsonSerializer.java | 274 +- .../json/mixins/AssetInformationMixin.java | 25 +- .../json/mixins/ConceptDescriptionMixin.java | 14 +- .../DataSpecificationIec61360Mixin.java | 25 +- .../dataformat/json/mixins/EntityMixin.java | 10 +- .../v3/dataformat/json/mixins/FileMixin.java | 3 +- .../json/mixins/HasExtensionsMixin.java | 5 +- .../mixins/MultiLanguagePropertyMixin.java | 15 +- .../json/mixins/QualifierMixin.java | 9 +- .../json/mixins/ReferableMixin.java | 21 +- .../json/mixins/SubmodelElementListMixin.java | 6 +- dataformat-json/src/main/resources/aas.json | 641 +++-- .../dataformat/json/JsonDeserializerTest.java | 29 +- .../json/JsonReferableDeserializerTest.java | 104 +- .../json/JsonReferableSerializerTest.java | 110 +- .../dataformat/json/JsonSerializerTest.java | 37 +- .../dataformat/json/JsonValidationTest.java | 32 +- .../ReflectionAnnotationIntrospectorTest.java | 2 +- .../resources/AssetAdministrationShell.json | 137 +- .../src/test/resources/MotorAAS.json | 101 +- .../src/test/resources/Submodel.json | 268 +- .../src/test/resources/SubmodelElement.json | 108 +- .../resources/SubmodelElementCollection.json | 168 +- .../test/resources/SubmodelElementList.json | 277 +- .../v3/dataformat/xml/XmlDeserializer.java | 130 +- .../v3/dataformat/xml/XmlSerializer.java | 111 +- ...mbeddedDataSpecificationsDeserializer.java | 41 +- .../OperationVariableDeserializer.java | 22 +- .../QualifierDeserializer.java | 16 +- .../ReferencesDeserializer.java | 6 +- .../SubmodelElementDeserializer.java | 3 +- .../SubmodelElementsDeserializer.java | 17 +- .../xml/internal/AasXmlNamespaceContext.java | 39 + .../xml/internal/SubmodelElementManager.java | 84 + .../XmlDataformatAnnotationIntrospector.java | 89 + .../mixins/AssetAdministrationShellMixin.java | 12 +- .../xml/mixins/AssetInformationMixin.java | 29 +- .../xml/mixins/ConceptDescriptionMixin.java | 9 +- .../DataSpecificationIec61360Mixin.java | 73 +- .../EmbeddedDataSpecificationMixin.java | 82 +- .../v3/dataformat/xml/mixins/EntityMixin.java | 21 +- .../xml/mixins/EnvironmentMixin.java | 4 +- .../xml/mixins/HasDataSpecificationMixin.java | 10 +- .../xml/mixins/HasExtensionsMixin.java | 3 +- .../v3/dataformat/xml/mixins/KeyMixin.java | 3 +- .../mixins/MultiLanguagePropertyMixin.java | 22 +- .../dataformat/xml/mixins/OperationMixin.java | 20 +- .../xml/mixins/OperationVariableMixin.java | 4 +- .../xml/mixins/QualifiableMixin.java | 10 +- .../dataformat/xml/mixins/QualifierMixin.java | 11 +- .../dataformat/xml/mixins/ReferableMixin.java | 40 +- .../dataformat/xml/mixins/ReferenceMixin.java | 3 +- .../dataformat/xml/mixins/ResourceMixin.java | 9 +- .../xml/mixins/SpecificAssetIDMixin.java | 13 +- .../SubmodelElementCollectionMixin.java | 3 +- .../xml/mixins/SubmodelElementMixin.java | 7 +- .../dataformat/xml/mixins/SubmodelMixin.java | 7 +- .../dataformat/xml/mixins/ValueListMixin.java | 18 +- .../xml/mixins/ValueReferencePairMixin.java | 11 +- .../AbstractLangStringSerializer.java | 2 +- .../AbstractLangStringsSerializer.java | 4 +- ...inistrationShellEnvironmentSerializer.java | 19 +- .../serialization/DataElementsSerializer.java | 3 +- .../EmbeddedDataSpecificationSerializer.java | 22 +- .../OperationVariableSerializer.java | 27 +- .../SubmodelElementSerializer.java | 12 +- .../SubmodelElementsSerializer.java | 5 +- dataformat-xml/src/main/resources/AAS.xsd | 1937 +++++++++----- .../dataformat/xml/XMLDeserializerTest.java | 63 +- .../v3/dataformat/xml/XmlSerializerTest.java | 110 +- .../v3/dataformat/xml/XmlValidationTest.java | 5 +- .../annotated_relationship_example.xml | 9 +- .../src/test/resources/invalidXmlExample.xml | 2 +- dataformat-xml/src/test/resources/minimum.xml | 7 +- .../src/test/resources/operation_example.xml | 47 +- .../src/test/resources/qualifier_example.xml | 6 +- .../test/resources/test_demo_full_example.xml | 2246 +++++------------ .../src/test/resources/xmlExample.xml | 170 +- .../xmlExampleWithModifiedPrefix.xml | 171 +- 98 files changed, 5400 insertions(+), 5126 deletions(-) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 0a3b4da65..5108b7bf9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -31,7 +33,7 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -47,8 +49,10 @@ public class AASXDeserializer { private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final String AASX_ORIGIN = "/aasx/aasx-origin"; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - private XmlDeserializer deserializer = new XmlDeserializer(); + + private final XmlDeserializer deserializer; private Environment environment; private final OPCPackage aasxRoot; @@ -62,6 +66,7 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); + this.deserializer = new XmlDeserializer(); } /** @@ -126,7 +131,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat // Read the content from the PackagePart InputStream stream = xmlPart.getInputStream(); StringWriter writer = new StringWriter(); - IOUtils.copy(stream, writer, Serializer.DEFAULT_CHARSET); + IOUtils.copy(stream, writer, DEFAULT_CHARSET); return writer.toString(); } @@ -134,7 +139,7 @@ private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormat * Load the referenced filepaths in the submodels such as PDF, PNG files from * the package * - * @return a map of the folder name and folder path, the folder holds the files + * @return a list of the folder name and folder path, the folder holds the files * @throws IOException if creating input streams for aasx fails * @throws InvalidFormatException if aasx package format is invalid * @throws DeserializationException if deserialization of the serialized aas environment fails @@ -161,15 +166,10 @@ private List parseElements(Collection elements) { for (SubmodelElement element : elements) { if (element instanceof File) { File file = (File) element; - // If the path contains a "://", we can assume, that the Path is a link to an - // other server - // e.g. http://localhost:8080/aasx/... - if (!file.getValue().contains("://")) { - paths.add(file.getValue()); - } + paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValue())); + paths.addAll(parseElements(collection.getValues())); } } return paths; @@ -193,7 +193,7 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc } private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { - PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(filePath)); + PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); InputStream stream = part.getInputStream(); return new InMemoryFile(stream.readAllBytes(), filePath); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 050dce41e..449be54c3 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ import java.io.IOException; import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -31,18 +33,20 @@ import org.apache.poi.openxml4j.opc.RelationshipSource; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; + /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels @@ -62,12 +66,15 @@ public class AASXSerializer { private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; - private Serializer xmlSerializer = new XmlSerializer(); + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + private final XmlSerializer xmlSerializer; /** * Default constructor */ public AASXSerializer() { + this.xmlSerializer = new XmlSerializer(); } /** @@ -75,7 +82,7 @@ public AASXSerializer() { * * @param xmlSerializer a custom serializer used for serializing the aas environment */ - public AASXSerializer(Serializer xmlSerializer) { + public AASXSerializer(XmlSerializer xmlSerializer) { this.xmlSerializer = xmlSerializer; } @@ -102,7 +109,7 @@ public void write(Environment environment, Collection files, Outpu String xml = xmlSerializer.write(environment); // Save the XML to aasx/xml/content.xml - PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(Serializer.DEFAULT_CHARSET)); + PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); storeFilesInAASX(environment.getSubmodels(), files, rootPackage, xmlPart); @@ -118,11 +125,11 @@ public void write(Environment environment, Collection files, Outpu * @param xmlPart the Part the files should be related to */ private void storeFilesInAASX(List submodelList, Collection files, OPCPackage rootPackage, - PackagePart xmlPart) { + PackagePart xmlPart) { for (Submodel sm : submodelList) { for (File file : findFileElements(sm.getSubmodelElements())) { - String filePath = file.getValue(); + String filePath = AASXUtils.getPathFromURL(file.getValue()); try { InMemoryFile content = findFileByPath(files, filePath); logger.trace("Writing file '" + filePath + "' to .aasx."); @@ -196,7 +203,7 @@ private PackagePart createAASXPart(OPCPackage root, RelationshipSource relateTo, * @param content the content to be written to the part */ private void writeDataToPart(PackagePart part, byte[] content) { - try (OutputStream ostream = part.getOutputStream();) { + try (OutputStream ostream = part.getOutputStream()) { ostream.write(content); ostream.flush(); } catch (Exception e) { @@ -219,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); } } @@ -245,7 +252,7 @@ private void prepareFilePaths(Collection submodels) { */ private InMemoryFile findFileByPath(Collection files, String path) { for (InMemoryFile file : files) { - if (preparePath(file.getPath()).equals(path)) { + if (AASXUtils.getPathFromURL(file.getPath()).equals(path)) { return file; } } @@ -253,51 +260,17 @@ private InMemoryFile findFileByPath(Collection files, String path) } /** - * Removes the serverpart from a path and ensures it starts with a slash + * Removes the serverpart from a path and ensures it starts with "file://" * * @param path the path to be prepared * @return the prepared path */ private String preparePath(String path) { - String newPath = getPathFromURL(path); - if (!newPath.startsWith("/")) { - newPath = "/" + newPath; + String newPath = AASXUtils.getPathFromURL(path); + if (!newPath.startsWith("file://")) { + newPath = "file://" + newPath; } return newPath; } - /** - * Gets the path from a URL e.g "http://localhost:8080/path/to/test.file" - * results in "/path/to/test.file" - * - * @param url - * @return the path from the URL - */ - private String getPathFromURL(String url) { - if (url == null) { - return null; - } - - if (url.contains("://")) { - - // Find the ":" and and remove the "http://" from the url - int index = url.indexOf(":") + 3; - url = url.substring(index); - - // Find the first "/" from the URL (now without the "http://") and remove - // everything before that - index = url.indexOf("/"); - url = url.substring(index); - - // Recursive call to deal with more than one server parts - // (e.g. basyx://127.0.0.1:6998//https://localhost/test/) - return getPathFromURL(url); - } else { - // Make sure the path has a / at the start - if (!url.startsWith("/")) { - url = "/" + url; - } - return url; - } - } } \ No newline at end of file diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 465f8b8be..77425197e 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,19 +47,20 @@ public class AASXDeserializerTest { @Test public void testRoundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { + List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXDeserializer deserializer = new AASXDeserializer(in); - assertEquals(AASSimple.ENVIRONMENT, deserializer.read()); + assertEquals(AASSimple.createEnvironment(), deserializer.read()); assertEquals(fileList, deserializer.getRelatedFiles()); } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index 5fe63adfb..6b1622c43 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,17 +29,16 @@ import javax.xml.parsers.ParserConfigurationException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.xml.sax.SAXException; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.xml.sax.SAXException; public class ValidationTest { @@ -51,12 +49,12 @@ public class ValidationTest { public void validateXmlInsideAasx() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "/aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(inMemoryFile); File file = tempFolder.newFile("output.aasx"); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, new FileOutputStream(file)); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); AASXValidator v = new AASXValidator(in); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index f3830bb2c..cfce0d5c1 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,15 +40,15 @@ public class AASXSerializerTest { - private static final String XML_PATH = "aasx/xml/content.xml"; - private static final String ORIGIN_PATH = "aasx/aasx-origin"; + private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; + private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; private List fileList = new ArrayList<>(); @Before public void setup() throws IOException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; - InMemoryFile file = new InMemoryFile(operationManualContent, "aasx/OperatingManual.pdf"); + InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); fileList.add(file); } @@ -62,7 +61,7 @@ public void testBuildAASX() throws IOException, TransformerException, ParserConf // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - new AASXSerializer().write(AASSimple.ENVIRONMENT, fileList, out); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); validateAASX(out); } @@ -74,7 +73,7 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { ArrayList filePaths = new ArrayList<>(); while ((zipEntry = in.getNextEntry()) != null) { - if (zipEntry.getName().equals(XML_PATH)) { + if (zipEntry.getName().equals(XML_PATH_URI)) { // Read the first 5 bytes of the XML file to make sure it is in fact XML file // No further test of XML file necessary as XML-Converter is tested separately @@ -85,11 +84,11 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { } // Write the paths of all files contained in the .aasx into filePaths - filePaths.add(zipEntry.getName()); + filePaths.add("file:///" + zipEntry.getName()); } - assertTrue(filePaths.contains(XML_PATH)); - assertTrue(filePaths.contains(ORIGIN_PATH)); + assertTrue(filePaths.contains(XML_PATH_URI)); + assertTrue(filePaths.contains(ORIGIN_PATH_URI)); // Check if all expected files are present // Needs to strip the first slash of the paths, as ZipEntry gives paths without diff --git a/dataformat-aasx/src/test/resources/jsonExample.json b/dataformat-aasx/src/test/resources/jsonExample.json index 26cd27970..f6421ef44 100644 --- a/dataformat-aasx/src/test/resources/jsonExample.json +++ b/dataformat-aasx/src/test/resources/jsonExample.json @@ -192,7 +192,7 @@ }, "idShort": "DigitalFile_PDF", "mimeType": "application/pdf", - "value": "/aasx/OperatingManual.pdf" + "value": "file:///aasx/OperatingManual.pdf" } ] } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java index f201050f7..26e0f1868 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; +@SuppressWarnings("serial") public class DeserializationException extends Exception { public DeserializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java index 00ccc1b95..981d657cb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat; +@SuppressWarnings("serial") public class SerializationException extends Exception { public SerializationException(String msg) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index b087fab00..76ba4040b 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +21,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; /** * Deserializes enum values converting element names from UpperCamelCase to @@ -30,7 +28,7 @@ * * @param Type of enum to deserialize */ -public class EnumDeserializer extends JsonDeserializer { +public class EnumDeserializer> extends JsonDeserializer { protected final Class type; @@ -48,7 +46,30 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I value = value.substring(0, 1).toUpperCase() + value.substring(1); } - return (T) Enum.valueOf(type, AasUtils.deserializeEnumName(value)); + return Enum.valueOf(type, deserializeEnumName(value)); } + /** + * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE + * + * @param input + * input name in CamelCase + * @return name in SCREAMING_SNAKE_CASE + */ + public static String deserializeEnumName(String input) { + String result = ""; + if (input == null || input.isEmpty()) { + return result; + } + result += Character.toUpperCase(input.charAt(0)); + for (int i = 1; i < input.length(); i++) { + char currentChar = input.charAt(i), previousChar = input.charAt(i - 1); + if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { + result += "_"; + } + result += Character.toUpperCase(currentChar); + } + return result; + } + } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index c0f3631a5..bc015d93e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,45 +18,81 @@ import java.io.IOException; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + /** * Serializes enum values. If enum is part of the AAS Java model, the name will * be converted from SCREAMING_SNAKE_CASE to UpperCamelCase, else default * serialization will be used */ +@SuppressWarnings("rawtypes") public class EnumSerializer extends JsonSerializer { - protected static final char UNDERSCORE = '_'; - - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { + @Override + public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (value instanceof DataTypeDefXsd) { // only for the DataTypeDefXsd notation if (value.equals(DataTypeDefXsd.ANY_URI)) { gen.writeString("xs:anyURI"); } else if (value.equals(DataTypeDefXsd.NON_NEGATIVE_INTEGER)) { - gen.writeString("xs:NonNegativeInteger"); + gen.writeString("xs:nonNegativeInteger"); + } else if(isTimeRelatedValue(value)) { + handleTimeRelatedValue(gen, value); } else { // pattern: 'xs:' + camelCase - String enum_string = AasUtils.serializeEnumName(value.name()); + String enum_string = serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { - gen.writeString(value.name()); + } else if (value instanceof DataTypeIec61360) { + gen.writeString(value.name().toUpperCase()); + } else if (value instanceof Direction || value instanceof StateOfEvent) { + gen.writeString(value.name().toLowerCase()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { - gen.writeString(AasUtils.serializeEnumName(value.name())); + gen.writeString(serializeEnumName(value.name())); } else { provider.findValueSerializer(Enum.class).serialize(value, gen, provider); } } + private void handleTimeRelatedValue(JsonGenerator gen, Enum value) throws IOException { + String enum_string = serializeEnumName(value.name()); + String adaptedEnumString = "xs:g" + enum_string.substring(1, 2).toUpperCase() + enum_string.substring(2); + gen.writeString(adaptedEnumString); + } + + private boolean isTimeRelatedValue(Enum value) { + String enum_string = serializeEnumName(value.name()); + return enum_string.startsWith("G"); + } + + /** + * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase + * + * @param input + * input name in SCREAMING_SNAKE_CASE + * @return name in CamelCase + */ + public static String serializeEnumName(String input) { + String result = ""; + boolean capitalize = true; + for (int i = 0; i < input.length(); i++) { + char currentChar = input.charAt(i); + if ('_' == currentChar) { + capitalize = true; + } else { + result += capitalize ? currentChar : Character.toLowerCase(currentChar); + capitalize = false; + } + } + return result; + } + } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index cd3b04514..46985b03e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,24 +16,38 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; -import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Type; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Operation; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.reflect.TypeToken; + /** * Provides utility functions related to AAS */ @@ -41,176 +55,29 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final char UNDERSCORE = '_'; - private static final String KEY_REGEX_GROUP_TYPE = "type"; - private static final String KEY_REGEX_GROUP_ID_TYPE = "idtype"; - private static final String KEY_REGEX_GROUP_VALUE = "value"; - private static final Pattern KEY_REGEX = Pattern.compile( - String.format("\\((?<%s>\\w+)\\)\\[(?<%s>\\w+)\\](?<%s>.*)", - KEY_REGEX_GROUP_TYPE, - KEY_REGEX_GROUP_ID_TYPE, - KEY_REGEX_GROUP_VALUE)); + private static final String REFERENCE_ELEMENT_DELIMITER = ", "; private AasUtils() { } - /** - * Formats a Reference as string - * - * @param reference Reference to serialize - * @return string representation of the reference for serialization, null if - * reference is null - */ - public static String asString(Reference reference) { - if (reference == null) { - return null; - } - return reference.getKeys().stream() - .map(x -> String.format("(%s)[%s]%s", - serializeEnumName(x.getType().name()), - x.getValue())) - .collect(Collectors.joining(",")); - } - - /** - * Parses a given string as Reference. If the given string is not a valid - * reference, null is returned. - * - * @param value String representation of the reference - * @return parsed Reference or null is given value is not a valid Reference - */ - public static Reference parseReference(String value) { - return parseReference(value, - ReflectionHelper.getDefaultImplementation(Reference.class), - ReflectionHelper.getDefaultImplementation(Key.class)); - } - - /** - * Parses a given string as Reference using the provided implementation of - * Reference and Key interface. If the given string is not a valid - * reference, null is returned. - * - * @param value String representation of the reference - * @param referenceType implementation type of Reference interface - * @param keyType implementation type of Key interface - * @return parsed Reference or null is given value is not a valid Reference - */ - public static Reference parseReference(String value, Class referenceType, Class keyType) { - if (value == null || value.isBlank()) { - return null; - } - try { - Reference result = referenceType.getConstructor().newInstance(); - result.setKeys(Stream.of(value.split(",")).map(x -> parseKey(x)).collect(Collectors.toList())); - // TODO: ReferenceType is ignored - // result.setType(Stream.of(value.split(",")).map(x -> parseReferenceType(x)).collect(Collectors.toList())); - return result; - } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new IllegalArgumentException("error parsing reference - could not instantiate reference type", ex); - } - } - - /** - * Gets property with given name as defined in type of given parent or null - * if not defined - * - * @param parent parent object - * @param propertyName name of the property - * @return property with given name as defined in type of given parent or - * null if not defined - */ - public static PropertyDescriptor getProperty(Object parent, String propertyName) { - if (parent == null || propertyName == null || propertyName.isBlank()) { - return null; - } - return getAasProperties(parent.getClass()).stream() - .filter(x -> x.getName().equals(propertyName)) - .findAny() - .orElse(null); - } - - /** - * Gets the content type of a generic collection type - * - * @param genericCollectionType the generic collection type - * @return the content type of the generic collection type - */ - public static Class getCollectionContentType(Type genericCollectionType) { - return TypeToken.of(genericCollectionType).resolveType(Collection.class.getTypeParameters()[0]).getRawType(); - } - - /** - * Gets property with given name as defined in given type or null if not - * defined - * - * @param type type containing the property - * @param propertyName name of the property - * @return property with given name as defined in given type or null if not - * defined - */ - public static PropertyDescriptor getProperty(Class type, String propertyName) { - if (type == null || propertyName == null || propertyName.isBlank()) { - return null; - } - return getAasProperties(type).stream() - .filter(x -> x.getName().equals(propertyName)) - .findAny() - .orElse(null); - } - - /** - * Parses a given string as Key. If the given string is not a valid key, - * null is returned. - * - * @param value String representation of the key - * @return parsed Key or null is given value is not a valid Key - */ - public static Key parseKey(String value) { - Matcher matcher = KEY_REGEX.matcher(value); - if (matcher.find()) { - KeyTypes keyType = KeyTypes.valueOf(deserializeEnumName(matcher.group(KEY_REGEX_GROUP_ID_TYPE))); - return new DefaultKey.Builder() - .type(keyType) - .value(matcher.group(KEY_REGEX_GROUP_VALUE)) - .build(); - } - return null; - } + /** + * Formats a Reference as string + * + * @param reference + * Reference to serialize + * @return string representation of the reference for serialization, null if + * reference is null + */ + private static String asString(Reference reference) { + if (reference == null) { + return null; + } + return String.format("[%s]%s", reference.getType(), + reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + } /** - * Checks if a reference is a local reference or not. This functionality may - * not be 100% correct as since v3.0RC01 of the AAS specification there no - * longer is an isLocal property to check this and no alternative way to - * determine whether a reference is local or not is introduced. This method - * only checks for the presence of any Key with type GLOBAL_REFERENCE. - * Another approach would be to actually try resolving the reference - * locally. - * - * @param reference The reference to check - * @param environment The environment context the reference resides. In - * current implementation this is not used - * @return true if the reference is a local reference to the given - * environment, false otherwise - */ - public static boolean isLocal(Reference reference, Environment environment) { - return !reference.getKeys().stream().anyMatch(x -> x.getType() == KeyTypes.GLOBAL_REFERENCE); - } - - public static List getSubmodelTemplates(AssetAdministrationShell aas, Environment environment) { - return aas.getSubmodels().stream() - .map(ref -> resolve(ref, environment, Submodel.class)) - .filter(sm -> sm != null) - .filter(sm -> sm.getKind() != ModelingKind.INSTANCE) - .collect(Collectors.toList()); - } - - public static boolean hasTemplate(AssetAdministrationShell aas, Environment environment) { - return !getSubmodelTemplates(aas, environment).isEmpty(); - } - - /** - * Creates a reference for an Identifiable instance using provided - * implementation types for reference and key + * Creates a reference for an Identifiable instance using provided implementation types for reference and key * * @param identifiable the identifiable to create the reference for * @param referenceType implementation type of Reference interface @@ -220,6 +87,7 @@ public static boolean hasTemplate(AssetAdministrationShell aas, Environment envi public static Reference toReference(Identifiable identifiable, Class referenceType, Class keyType) { try { Reference reference = referenceType.getConstructor().newInstance(); + reference.setType(ReferenceTypes.MODEL_REFERENCE); Key key = keyType.getConstructor().newInstance(); key.setType(referableToKeyType(identifiable)); key.setValue(identifiable.getId()); @@ -244,93 +112,44 @@ public static Reference toReference(Identifiable identifiable) { * Gets the KeyElements type matching the provided Referable * * @param referable The referable to convert to KeyElements type - * @return the most specific KeyElements type representing the Referable, - * i.e. abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT are never - * returned; null if there is no corresponding KeyElements type + * @return the most specific KeyElements type representing the Referable, i.e. abstract types like SUBMODEL_ELEMENT + * or DATA_ELEMENT are never returned; null if there is no corresponding KeyElements type */ public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); } return null; } - /** - * Translates an enum value from SCREAMING_SNAKE_CASE to CamelCase - * - * @param input input name in SCREAMING_SNAKE_CASE - * @return name in CamelCase - */ - public static String serializeEnumName(String input) { - String result = ""; - boolean capitalize = true; - for (int i = 0; i < input.length(); i++) { - char currentChar = input.charAt(i); - if (UNDERSCORE == currentChar) { - capitalize = true; - } else { - result += capitalize - ? currentChar - : Character.toLowerCase(currentChar); - capitalize = false; - } - } - return result; - } - - /** - * Translates an enum value from CamelCase to SCREAMING_SNAKE_CASE - * - * @param input input name in CamelCase - * @return name in SCREAMING_SNAKE_CASE - */ - public static String deserializeEnumName(String input) { - String result = ""; - if (input == null || input.isEmpty()) { - return result; - } - result += Character.toUpperCase(input.charAt(0)); - for (int i = 1; i < input.length(); i++) { - char currentChar = input.charAt(i), - previousChar = input.charAt(i - 1); - if (Character.isUpperCase(currentChar) && Character.isLowerCase(previousChar)) { - result += UNDERSCORE; - } - result += Character.toUpperCase(currentChar); - } - return result; - } - /** * Gets a Java interface representing the type provided by key. * * @param key The KeyElements type - * @return a Java interface representing the provided KeyElements type or - * null if no matching Class/interface could be found. It also returns - * abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT + * @return a Java interface representing the provided KeyElements type or null if no matching Class/interface could + * be found. It also returns abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT */ - public static Class keyTypeToClass(KeyTypes key) { + private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } /** - * Creates a reference for an element given a potential parent using - * provided implementation types for reference and key + * Creates a reference for an element given a potential parent using provided implementation types for reference and + * key * - * @param parent Reference to the parent. Can only be null when element is - * instance of Identifiable, otherwise result will always be null + * @param parent Reference to the parent. Can only be null when element is instance of Identifiable, otherwise + * result will always be null * @param element the element to create a reference for * @param referenceType implementation type of Reference interface * @param keyType implementation type of Key interface * - * @return A reference representing the element or null if either element is - * null or parent is null and element not an instance of Identifiable. In - * case element is an instance of Identifiable, the returned reference will - * only contain one key pointing directly to the element. + * @return A reference representing the element or null if either element is null or parent is null and element not + * an instance of Identifiable. In case element is an instance of Identifiable, the returned reference will only + * contain one key pointing directly to the element. */ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { if (element == null) { @@ -356,13 +175,12 @@ public static Reference toReference(Reference parent, Referable element, Class referenceType, Class keyType) { + private static Reference clone(Reference reference, Class referenceType, Class keyType) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } try { Reference result = referenceType.getConstructor().newInstance(); List newKeys = new ArrayList<>(); + result.setType(reference.getType()); for (Key key : reference.getKeys()) { Key newKey = keyType.getConstructor().newInstance(); newKey.setType(key.getType()); @@ -449,15 +256,13 @@ public static Reference clone(Reference reference, Class re } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and - * returns the targeted object if available, null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, + * null otherwise * * * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the - * reference against - * @return returns an instance of T if the reference could successfully be - * resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the reference against + * @return returns an instance of T if the reference could successfully be resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ public static Referable resolve(Reference reference, Environment env) { @@ -465,21 +270,18 @@ public static Referable resolve(Reference reference, Environment env) { } /** - * Resolves a Reference within an AssetAdministrationShellEnvironment and - * returns the targeted object if available, null otherwise + * Resolves a Reference within an AssetAdministrationShellEnvironment and returns the targeted object if available, + * null otherwise * - * @param sub-type of Referable of the targeted type. If unknown use - * Referable.class + * @param sub-type of Referable of the targeted type. If unknown use Referable.class * @param reference The reference to resolve - * @param env The AssetAdministrationShellEnvironment to resolve the - * reference against - * @param type desired return type, use Referable.class is unknwon/not - * needed - * @return returns an instance of T if the reference could successfully be - * resolved, otherwise null + * @param env The AssetAdministrationShellEnvironment to resolve the reference against + * @param type desired return type, use Referable.class is unknwon/not needed + * @return returns an instance of T if the reference could successfully be resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ - public static T resolve(Reference reference, Environment env, Class type) { + @SuppressWarnings("unchecked") + public static T resolve(Reference reference, Environment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -528,42 +330,54 @@ public static T resolve(Reference reference, Environment e Key key = reference.getKeys().get(i); Class keyType = keyTypeToClass(key.getType()); if (keyType != null) { - Collection collection; - // operation needs special handling because of nested values - if (Operation.class.isAssignableFrom(current.getClass())) { - Operation operation = (Operation) current; - - collection = Stream.of(operation.getInputVariables().stream(), - operation.getOutputVariables().stream(), - operation.getInoutputVariables().stream()) - .flatMap(x -> x.map(y -> y.getValue())) - .collect(Collectors.toSet()); - } else { - List matchingProperties = getAasProperties(current.getClass()).stream() - .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) - .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) - .resolveType(Collection.class.getTypeParameters()[0]) - .isSupertypeOf(keyType)) - .collect(Collectors.toList()); - if (matchingProperties.isEmpty()) { - throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", - keyType.getSimpleName(), - current.getClass().getSimpleName())); - } - if (matchingProperties.size() > 1) { - throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", - matchingProperties.size(), - current.getClass().getSimpleName(), - matchingProperties.stream() - .map(x -> x.getName()) - .collect(Collectors.joining(", ")))); - } + if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); - } catch (Exception ex) { - throw new IllegalArgumentException("error resolving reference", ex); + current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); + } catch (NumberFormatException ex) { + throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", + i, key.getValue())); + } catch (IndexOutOfBoundsException ex) { + throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", + i, + ((SubmodelElementList) current).getValues().size(), + key.getValue())); + } + } else { + Collection collection; + if (Operation.class.isAssignableFrom(current.getClass())) { + Operation operation = (Operation) current; + collection = Stream.of(operation.getInputVariables().stream(), + operation.getOutputVariables().stream(), + operation.getInoutputVariables().stream()) + .flatMap(x -> x.map(y -> y.getValue())) + .collect(Collectors.toSet()); + } else { + List matchingProperties = getAasProperties(current.getClass()).stream() + .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) + .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) + .resolveType(Collection.class.getTypeParameters()[0]) + .isSupertypeOf(keyType)) + .collect(Collectors.toList()); + if (matchingProperties.isEmpty()) { + throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", + keyType.getSimpleName(), + current.getClass().getSimpleName())); + } + if (matchingProperties.size() > 1) { + throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", + matchingProperties.size(), + current.getClass().getSimpleName(), + matchingProperties.stream() + .map(x -> x.getName()) + .collect(Collectors.joining(", ")))); + } + try { + collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { + throw new IllegalArgumentException("error resolving reference", ex); + } } - Optional next = collection.stream() + Optional next = collection.stream() .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) .findFirst(); if (next.isEmpty()) { @@ -577,16 +391,14 @@ public static T resolve(Reference reference, Environment e } /** - * Gets a list of all properties defined for a class implementing at least - * one AAS interface. + * Gets a list of all properties defined for a class implementing at least one AAS interface. * - * @param type A class implementing at least one AAS interface. If it is - * does not implement any AAS interface the result will be an empty list - * @return a list of all properties defined in any of AAS interface - * implemented by type. If type does not implement any AAS interface an - * empty list is returned. + * @param type A class implementing at least one AAS interface. If it is does not implement any AAS interface the + * result will be an empty list + * @return a list of all properties defined in any of AAS interface implemented by type. If type does not implement + * any AAS interface an empty list is returned. */ - public static List getAasProperties(Class type) { + private static List getAasProperties(Class type) { Class aasType = ReflectionHelper.getAasInterface(type); if (aasType == null) { aasType = ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream() @@ -613,4 +425,4 @@ public static List getAasProperties(Class type) { .sorted(Comparator.comparing(x -> x.getName())) .collect(Collectors.toList()); } -} +} \ No newline at end of file diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index e20d26153..483d4a0d9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +19,53 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; public class AASFull { @@ -40,64 +84,50 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_2 = createConceptDescription2(); public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); - public static final Environment ENVIRONMENT = createEnvironment(); public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() - )) + .description(new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build()) + .description(new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + ) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) - //.billOfMaterial((new DefaultReference.Builder() - // .keys(new DefaultKey.Builder() - // .type(KeyTypes.SUBMODEL) - // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") - // .build())) - // .build()) + .globalAssetId("https://acplt.org/Test_Asset") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -108,27 +138,21 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -139,13 +163,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -153,31 +171,25 @@ public static AssetAdministrationShell createAAS3() { public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Missing") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -185,28 +197,31 @@ public static AssetAdministrationShell createAAS4() { public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .displayName( + new DefaultLangStringNameType.Builder().text("Manufacturer Name").language("en-us").build() + ) + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -214,7 +229,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -226,21 +241,22 @@ public static Submodel createSubmodel1() { .type("http://acplt.org/Qualifier/ExampleQualifier2") .valueType(DataTypeDefXsd.INT) .build()) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ACPLT") + .value("http://acplt.org/valueId/ACPLT") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .category("VARIABLE") + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -248,8 +264,23 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .supplementalSemanticIds(Arrays.asList( + new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("something_random_e14ad770") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build(), + new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("something_random_bd061acd") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build())) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -257,7 +288,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build(); @@ -266,106 +297,100 @@ public static Submodel createSubmodel1() { public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") + .version("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValue2") + .value("http://acplt.org/valueId/ExampleValue2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset2") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -373,36 +398,36 @@ public static Submodel createSubmodel2() { public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -438,16 +463,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -480,7 +505,6 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -489,41 +513,40 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -532,24 +555,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -558,24 +581,24 @@ public static Submodel createSubmodel3() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -584,16 +607,16 @@ public static Submodel createSubmodel3() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -601,16 +624,16 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -632,113 +655,114 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .values(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") + .value("http://acplt.org/valueId/ExampleMultiLanguagevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) - .value(new DefaultRange.Builder() + .value(new DefaultRange.Builder() // TODO: a SME-List must only contain one SME-Type, e.g. Property or Range .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -746,16 +770,16 @@ public static Submodel createSubmodel3() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -763,16 +787,16 @@ public static Submodel createSubmodel3() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -787,7 +811,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build()) @@ -798,7 +822,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -867,7 +891,6 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -910,6 +933,7 @@ public static Submodel createSubmodel4() { .max(null) .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") @@ -935,7 +959,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -943,35 +967,36 @@ public static Submodel createSubmodel5() { public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0").build()) + .version("0") + .revision("9") + .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1007,16 +1032,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1049,7 +1074,6 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1058,33 +1082,32 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1098,16 +1121,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1121,16 +1144,16 @@ public static Submodel createSubmodel6() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty3") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1144,16 +1167,16 @@ public static Submodel createSubmodel6() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1161,16 +1184,16 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .direction(Direction.INPUT) .state(StateOfEvent.ON) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1185,7 +1208,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1193,30 +1216,30 @@ public static Submodel createSubmodel6() { .category("PARAMETER") .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1228,68 +1251,69 @@ public static Submodel createSubmodel6() { .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + .values(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1297,16 +1321,16 @@ public static Submodel createSubmodel6() { .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1314,16 +1338,16 @@ public static Submodel createSubmodel6() { .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1348,39 +1372,38 @@ public static Submodel createSubmodel6() { public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1415,18 +1438,17 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultAnnotatedRelationshipElement.Builder() .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1460,36 +1482,33 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1498,18 +1517,17 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1518,18 +1536,17 @@ public static Submodel createSubmodel7() { .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1538,36 +1555,34 @@ public static Submodel createSubmodel7() { .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") .category("PARAMETER") .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1588,68 +1603,64 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementListOrdered") .category("PARAMETER") .orderRelevant(true) - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultMultiLanguageProperty.Builder() .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1657,105 +1668,100 @@ public static Submodel createSubmodel7() { .value(new DefaultRange.Builder() .idShort("ExampleRange2") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) .build()) + .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() .idShort("ExampleFile") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) .value(new DefaultReferenceElement.Builder() .idShort("ExampleReferenceElement") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") - .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1763,21 +1769,21 @@ public static Submodel createSubmodel7() { public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -1792,14 +1798,15 @@ public static ConceptDescription createConceptDescription2() { public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") - .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + .descriptions(Arrays.asList( + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) + .category("PROPERTY") .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .build(); } @@ -1809,71 +1816,66 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangString.Builder().text("Test Specification").language("de").build(), - new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredNames(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") -// .levelType(LevelType.MIN) - .levelType(LevelType.MAX) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") + .value("http://acplt.org/valueId/ExamplevalueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - // TODO valueType? .build()) .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") + .value("http://acplt.org/valueId/ExamplevalueId2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - // TODO valueType? .build()) .build()) .build()) @@ -1904,4 +1906,4 @@ public static Environment createEnvironment() { .build(); } -} \ No newline at end of file +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index d48733dae..a57f4a418 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,39 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.junit.Assert; +import org.junit.Test; public class AASSimple { @@ -29,7 +59,7 @@ public class AASSimple { private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DOCUMENT = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"; private static final String ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED = "Actual rotationspeed with which the motor or feedingunit is operated"; private static final String AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD = "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird"; - private static final String ACTUAL_ROTATION_SPEED = "ActualRotationSpeed"; + private static final String ACTUAL_ROTATION_SPEED = "ActRotationSpeed"; private static final String ACTUALROTATIONSPEED = "Actualrotationspeed"; private static final String AKTUELLE_DREHZAHL = "AktuelleDrehzahl"; private static final String _1_MIN = "1/min"; @@ -51,10 +81,8 @@ public class AASSimple { private static final String TITEL = "Titel"; private static final String WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE = "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"; private static final String TITLE = "Title"; - private static final String SERVO_DC_MOTOR = "ServoDCMotor"; private static final String FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG = "file:///master/verwaltungsschale-detail-part1.png"; private static final String IMAGE_PNG = "image/png"; - private static final String THUMBNAIL = "thumbnail"; private static final String HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1 = "http://customer.com/Systems/IoT/1"; private static final String QJ_YG_PGGJWKI_HK4_RR_QI_YS_LG = "QjYgPggjwkiHk4RrQiYSLg=="; private static final String DEVICE_ID = "DeviceID"; @@ -84,7 +112,6 @@ public class AASSimple { private static final String SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_DESCRIPTION_TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT = TITLE; private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUE = "OperatingManual"; - private static final String SUBMODEL_DOCUMENTATION_PROPERTY_VALUETYPE = "langString"; private static final String SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID = WWW_VDI2770_COM_BLATT1_ENTWURF_OKT18_CD_STORED_DOCUMENT_REPRESENTATION_DIGITAL_FILE; private static final String SUBMODEL_DOCUMENTATION_FILE_ID_SHORT = "DigitalFile_PDF"; private static final String SUBMODEL_DOCUMENTATION_FILE_contentType = "application/pdf"; @@ -97,7 +124,6 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT = ROTATION_SPEED; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; - private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; public AASSimple() { @@ -112,7 +138,6 @@ public AASSimple() { public static final ConceptDescription CONCEPT_DESCRIPTION_MAXROTATIONSPEED = createConceptDescriptionMaxRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_ROTATIONSPEED = createConceptDescriptionRotationSpeed(); public static final ConceptDescription CONCEPT_DESCRIPTION_DOCUMENT = createConceptDescriptionDocument(); - public static final Environment ENVIRONMENT = createEnvironment(); public static AssetAdministrationShell createAAS() { return new DefaultAssetAdministrationShell.Builder() @@ -120,13 +145,7 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -135,7 +154,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -146,7 +165,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -159,7 +178,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -167,20 +186,19 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) .build(); } - public static Submodel createSubmodelTechnicalData() { return new DefaultSubmodel.Builder() .semanticId(new DefaultReference.Builder() @@ -188,19 +206,17 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -212,17 +228,16 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -234,40 +249,37 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -289,17 +301,17 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) - .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .dataType(DataTypeIec61360.STRING_TRANSLATABLE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -315,18 +327,18 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) + new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING) - .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .dataType(DataTypeIec61360.STRING) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -337,7 +349,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("2.1") + .revision("1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( @@ -347,23 +359,23 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -381,26 +393,26 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -416,16 +428,16 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIEC61360.STRING) - .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) + .dataType(DataTypeIec61360.STRING) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); @@ -444,4 +456,11 @@ public static Environment createEnvironment() { .conceptDescriptions(createConceptDescriptionDocument()) .build(); } + + @Test + public void testAasSimpleExtensionsInitialized() { + List extensions = AASSimple.createEnvironment().getAssetAdministrationShells().get(0).getExtensions(); + Assert.assertTrue(extensions != null); + } + } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index d22adf747..b9bc9de24 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; import java.util.Objects; @@ -35,7 +28,7 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModelingKind kind; + protected ModellingKind kind; protected Reference semanticId; @@ -49,9 +42,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -84,7 +77,7 @@ public boolean equals(Object obj) { && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } @@ -130,32 +123,22 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescriptions() { return description; } @Override - final public void setDescription(List description) { + final public void setDescriptions(List description) { this.description = description; } @Override - public String getChecksum() { - return null; - } - - @Override - public void setChecksum(String checksum) { - - } - - @Override - final public List getDisplayName() { + final public List getDisplayNames() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayNames(List displayName) { this.displayName = displayName; } @@ -189,16 +172,6 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - final public ModelingKind getKind() { - return kind; - } - - @Override - final public void setKind(ModelingKind kind) { - this.kind = kind; - } - @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index efd6ef3a1..5908adfb9 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -1,25 +1,9 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -27,7 +11,8 @@ import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; public class EnumDeserializerTest { @@ -40,22 +25,38 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); + } + @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIEC61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIEC61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIEC61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIEC61360.IRI); + assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIec61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIec61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIec61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIec61360.IRI); } @Test @@ -70,7 +71,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - private void assertDeserialization(String value, Enum expected) { + @SuppressWarnings("rawtypes") + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 422766102..2fb858cc0 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,34 +1,18 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; public class EnumSerializerTest { @@ -52,40 +36,35 @@ public void setUp() throws Exception { @Test public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIEC61360.DATE, "DATE"); - assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIEC61360.STRING, "STRING"); - assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIEC61360.TIME, "TIME"); - assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIEC61360.IRI, "IRI"); + assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIec61360.DATE, "DATE"); + assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIec61360.STRING, "STRING"); + assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIec61360.TIME, "TIME"); + assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIec61360.IRI, "IRI"); } @Test - public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { - assertSerialization(Direction.INPUT, "INPUT"); - assertSerialization(Direction.OUTPUT, "OUTPUT"); + public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { + assertSerialization(Direction.INPUT, "input"); + assertSerialization(Direction.OUTPUT, "output"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { - assertSerialization(StateOfEvent.ON, "ON"); - assertSerialization(StateOfEvent.OFF, "OFF"); + public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { + assertSerialization(StateOfEvent.ON, "on"); + assertSerialization(StateOfEvent.OFF, "off"); } - @Test - public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { - assertSerialization(ModelingKind.INSTANCE, "Instance"); - assertSerialization(ModelingKind.TEMPLATE, "Template"); - } - private void assertSerialization(Enum value, String expected) { + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { this.enumSerializer.serialize(value, jsonGeneratorMock, serializerProviderMock); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java index 748aa4bf9..dc5eed87f 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/TypedProperty.java @@ -15,8 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.model; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; - public interface TypedProperty extends Property { } diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index db3ad313d..6b807cc93 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -13,12 +13,12 @@ - ${groupId} + ${project.groupId} dataformat-core ${revision} - ${groupId} + ${project.groupId} dataformat-core ${revision} tests diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 406ea22e3..d44cafa7f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,36 +15,40 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; - - /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { +public class JsonDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - // TODO - protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( - /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); + + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonDeserializer() { initTypeResolver(); @@ -59,22 +62,15 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) - .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - protected SimpleModule buildCustomDeserializerModule() { - SimpleModule module = new SimpleModule(); - customDeserializers.forEach(module::addDeserializer); - return module; - } - - private void initTypeResolver() { + @SuppressWarnings("unchecked") + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() - .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -90,119 +86,255 @@ protected SimpleModule buildImplementationModule() { return module; } - @Override + + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ public Environment read(String value) throws DeserializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); - return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); + return mapper.readValue(value, Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - @Override + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - @Override - public T readReferable(String referable, Class outputClass) throws DeserializationException { + /** + * Deserializes a given string into an instance of the given Referable + * + * @param src a string representation of the Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ public T readReferable(String src, Class outputClass) throws DeserializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); - return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); + return mapper.readValue(src, outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - @Override - public List readReferables(String referables, Class outputClass) throws DeserializationException { - try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referables", ex); - } + /** + * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public T readReferable(InputStream src, Class outputClass) throws DeserializationException { + return readReferable(src, DEFAULT_CHARSET, outputClass); } - @Override - public Reference readReference(String reference) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the Reference", ex); - } + /** + * Deserializes a given input stream into an instance of the given Referable + * + * @param src a input stream representing a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { + return readReferable(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); } - @Override - public List readReferences(String references) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of References", ex); - } + /** + * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a file containing string representation of a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferable(src, DEFAULT_CHARSET, outputClass); } - @Override - public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SpecificAssetId", ex); - } + /** + * Deserializes a given file into an instance of the given Referable + * + * @param src a file containing string representation of a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferable(new FileInputStream(src), charset, outputClass); } - @Override - public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { + /** + * Deserializes a given string into an instance of a list of the given Referables + * + * @param referables a string representation of an array of Referables + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of a list of the referables + * @throws DeserializationException if deserialization of referable fails + */ public List readReferables(String referables, Class outputClass) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(referables, new TypeReference>() { + }); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); + throw new DeserializationException("error deserializing list of Referable", ex); } } - @Override - public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); - } + + /** + * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Class outputClass) throws DeserializationException { + return readReferables(src, DEFAULT_CHARSET, outputClass); } - @Override - public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); - } + /** + * Deserializes a given input stream into an instance of a list of the given Referable + * + * @param src a input stream representing a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { + return readReferables(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); } - @Override - public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { - try { - return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); - } + /** + * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET + * + * @param src a file containing string representation of a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferables(src, DEFAULT_CHARSET, outputClass); } - @Override - public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { - try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); - } + /** + * Deserializes a given file into an instance of a list of the given Referable + * + * @param src a file containing string representation of a Referable + * @param charset the charset to use + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + * @throws java.io.FileNotFoundException if file is not found + */ + public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { + return readReferables(new FileInputStream(src), charset, outputClass); } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 31310e560..563e3506e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,32 +15,35 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; - -import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to - * JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. */ -public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { +public class JsonSerializer { protected JsonMapper mapper; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + public JsonSerializer() { buildMapper(); } @@ -51,194 +53,136 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) - .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - protected SimpleModule buildCustomSerializerModule() { - SimpleModule module = new SimpleModule(); - // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); - return module; - } - protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - @Override + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ public String write(Environment aasEnvironment) throws SerializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); - return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); + return mapper.writeValueAsString(aasEnvironment); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - @Override - public String writeReferable(Referable referable) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(referable)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - @Override - public String writeReferables(List referables) throws SerializationException { - if(referables.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); - String json = objectWriter.writeValueAsString(referables); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); - } - } - - @Override - public String writeReference(Reference reference) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(reference)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - @Override - public String writeReferences(List references) throws SerializationException { - if(references.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); - String json = objectWriter.writeValueAsString(references); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of References", ex); - } - } - - @Override - public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SpecificAssetId", ex); - } + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); } - @Override - public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { - if(specificAssetIds.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); - String json = objectWriter.writeValueAsString(specificAssetIds); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SpecificAssetIds", ex); + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); } } - @Override - public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SubmodelDescriptor", ex); + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); } } - @Override - public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { - if(submodelDescriptors.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); - String json = objectWriter.writeValueAsString(submodelDescriptors); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SubmodelDescriptors", ex); - } + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); } - @Override - public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { + /** + * Serializes a given instance of a Referable to string + * + * @param referable the referable to serialize + * @return the string representation of the referable + * @throws SerializationException if serialization fails + */ + public String write(Referable referable) throws SerializationException { try { - return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); + return mapper.writeValueAsString(referable); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); + throw new SerializationException("error serializing Referable", ex); } } - @Override - public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { - if(assetAdministrationShellDescriptors.isEmpty()){ + /** + * + * @param referables the referables to serialize + * @return the string representation of the list of referables + * @throws SerializationException if serialization fails + */ + public String write(Collection referables) throws SerializationException { + if (referables == null) { return null; - } + } else if (referables.isEmpty()) { + return mapper.createArrayNode().toString(); + } try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); - String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - + return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) + .writeValueAsString(referables); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); + throw new SerializationException("error serializing list of Referables", ex); } } - - - -// @Override -// public String write(Object aas_element) throws SerializationException { -// try { -// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore -// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); -// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); -// -// } catch (JsonProcessingException ex) { -// throw new SerializationException("error serializing an aas-element", ex); -// } -// } - -// @Override -// public String writeList(List aas_elements, Class outputClass) throws SerializationException { -// if(aas_elements.isEmpty()){ -// return null; -// } -// -// try { -// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); -// String json = objectWriter.writeValueAsString(aas_elements); -// -// return mapper.writeValueAsString(this.mapper.readTree(json)); -// -// } catch (JsonProcessingException ex) { -// throw new SerializationException("error serializing list of AAS elements", ex); -// } -// } } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 692601fde..1e88c6d7f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,28 +16,18 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; - import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; public interface AssetInformationMixin { - @JsonProperty("thumbnail") - public void setDefaultThumbnail(File value); - - @JsonProperty("thumbnail") - public File getDefaultThumbnail(); - - @JsonProperty("billOfMaterial") - public List getBillOfMaterials(); - - @JsonProperty("billOfMaterial") - public void setBillOfMaterials(List billOfMaterials); - @JsonInclude(JsonInclude.Include.ALWAYS) public AssetKind getAssetKind(); + + @JsonProperty("globalAssetId") + public String getGlobalAssetID(); + + @JsonProperty("globalAssetId") + public void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 919c02f51..f5aadcd1b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,23 +16,14 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOfs(); + public List getIsCaseOf(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOfs); -// -// @JsonProperty("embeddedDataSpecifications") -// public List getEmbeddedDataSpecifications(); -// -// @JsonProperty("embeddedDataSpecifications") -// @JsonDeserialize(using = DataSpecificationDeserializer.class) - - // TODO public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); + public void setIsCaseOfs(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 67576b8cd..88ec3908d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,32 +17,30 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -// TODO import io.adminshell.aas.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); - // TODO - // @JsonProperty("levelType") - // public void setLevelTypes(List levelTypes); + @JsonProperty("levelType") + public void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + public List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + public void setPreferredName(List preferredName); - @JsonProperty("shortName") - public List getShortName(); + @JsonProperty("unitId") + public Reference getUnitID(); - @JsonProperty("shortName") - public void setShortName(List shortName); + public @JsonProperty("unitId") + void setUnitID(Reference unitID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index e32fd4385..c6d9a89ef 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +18,15 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public EntityType getEntityType(); - @JsonProperty("specificAssetIds") - public SpecificAssetId getExternalAssetId(); + @JsonProperty("globalAssetId") + public String getGlobalAssetID(); - @JsonProperty("specificAssetIds") - public void setExternalAssetId(SpecificAssetId externalAssetId); + @JsonProperty("globalAssetId") + public void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 70c41f799..91b903b08 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,5 +20,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getMimeType(); + public String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index b39b6a735..d97c658e3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,9 +23,9 @@ public interface HasExtensionsMixin { - @JsonProperty("extensions") + @JsonProperty("extension") public List getExtensions(); - @JsonProperty("extensions") + @JsonProperty("extension") public void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index 554ce2b7c..cacb010eb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +16,22 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + public List getValue(); @JsonProperty("value") - public void setValue(LangString value); + public void setValue(LangStringTextType value); + + @JsonProperty("valueId") + public Reference getValueID(); + + @JsonProperty("valueId") + public void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 18da0db82..6cdd8c2a3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +16,17 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { @JsonInclude(JsonInclude.Include.ALWAYS) public String getType(); + + @JsonProperty("valueId") + public Reference getValueID(); + + @JsonProperty("valueId") + void setValueID(Reference valueID); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index c98dd784a..d93eb2c17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,31 +15,23 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import java.util.List; -import java.util.Set; public interface ReferableMixin { - @JsonProperty("idShort") - public String getIdShort(); - - @JsonProperty("idShort") - public void setIdShort(String idShort); - @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + public void setDisplayName(List displayNames); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 68ad53ec7..5ca0161db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.Collection; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 3d0b2a302..496811106 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -7,7 +7,7 @@ "$ref": "#/definitions/Environment" } ], - "$id": "https://admin-shell.io/aas/3/0/RC02", + "$id": "https://admin-shell.io/aas/3/0", "definitions": { "AasSubmodelElements": { "type": "string", @@ -31,6 +31,24 @@ "SubmodelElementList" ] }, + "AbstractLangString": { + "type": "object", + "properties": { + "language": { + "type": "string", + "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + }, + "text": { + "type": "string", + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + } + }, + "required": [ + "language", + "text" + ] + }, "AdministrativeInformation": { "allOf": [ { @@ -40,11 +58,42 @@ "properties": { "version": { "type": "string", - "minLength": 1 + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] }, "revision": { "type": "string", - "minLength": 1 + "allOf": [ + { + "minLength": 1, + "maxLength": 4 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^(0|[1-9][0-9]*)$" + } + ] + }, + "creator": { + "$ref": "#/definitions/Reference" + }, + "templateId": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } } } @@ -53,16 +102,19 @@ "AnnotatedRelationshipElement": { "allOf": [ { - "$ref": "#/definitions/RelationshipElement" + "$ref": "#/definitions/RelationshipElement_abstract" }, { "properties": { "annotations": { "type": "array", "items": { - "$ref": "#/definitions/DataElement" + "$ref": "#/definitions/DataElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "AnnotatedRelationshipElement" } } } @@ -90,6 +142,9 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 + }, + "modelType": { + "const": "AssetAdministrationShell" } }, "required": [ @@ -105,7 +160,10 @@ "$ref": "#/definitions/AssetKind" }, "globalAssetId": { - "$ref": "#/definitions/Reference" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "specificAssetIds": { "type": "array", @@ -114,6 +172,12 @@ }, "minItems": 1 }, + "assetType": { + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, "defaultThumbnail": { "$ref": "#/definitions/Resource" } @@ -126,6 +190,7 @@ "type": "string", "enum": [ "Instance", + "NotApplicable", "Type" ] }, @@ -147,22 +212,27 @@ }, "messageTopic": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 255, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "messageBroker": { "$ref": "#/definitions/Reference" }, "lastUpdate": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" }, "minInterval": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" }, "maxInterval": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\\.[0-9]+)?S)?|([0-9]+(\\.[0-9]+)?S))))$" + }, + "modelType": { + "const": "BasicEventElement" } }, "required": [ @@ -186,8 +256,21 @@ }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] + }, + "modelType": { + "const": "Blob" } }, "required": [ @@ -197,7 +280,18 @@ ] }, "Capability": { - "$ref": "#/definitions/SubmodelElement" + "allOf": [ + { + "$ref": "#/definitions/SubmodelElement" + }, + { + "properties": { + "modelType": { + "const": "Capability" + } + } + } + ] }, "ConceptDescription": { "allOf": [ @@ -215,6 +309,9 @@ "$ref": "#/definitions/Reference" }, "minItems": 1 + }, + "modelType": { + "const": "ConceptDescription" } } } @@ -223,6 +320,28 @@ "DataElement": { "$ref": "#/definitions/SubmodelElement" }, + "DataElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/MultiLanguageProperty" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + } + ] + }, "DataSpecificationContent": { "type": "object", "properties": { @@ -234,7 +353,14 @@ "modelType" ] }, - "DataSpecificationIEC61360": { + "DataSpecificationContent_choice": { + "oneOf": [ + { + "$ref": "#/definitions/DataSpecificationIec61360" + } + ] + }, + "DataSpecificationIec61360": { "allOf": [ { "$ref": "#/definitions/DataSpecificationContent" @@ -244,129 +370,68 @@ "preferredName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringPreferredNameTypeIec61360" }, "minItems": 1 }, "shortName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringShortNameTypeIec61360" }, "minItems": 1 }, "unit": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "unitId": { "$ref": "#/definitions/Reference" }, "sourceOfDefinition": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "symbol": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "dataType": { - "$ref": "#/definitions/DataTypeIEC61360" + "$ref": "#/definitions/DataTypeIec61360" }, "definition": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringDefinitionTypeIec61360" }, "minItems": 1 }, "valueFormat": { "type": "string", - "minLength": 1 + "minLength": 1, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueList": { "$ref": "#/definitions/ValueList" }, "value": { - "type": "string" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "levelType": { "$ref": "#/definitions/LevelType" - } - }, - "required": [ - "preferredName" - ] - } - ] - }, - "DataSpecificationPhysicalUnit": { - "allOf": [ - { - "$ref": "#/definitions/DataSpecificationContent" - }, - { - "properties": { - "unitName": { - "type": "string", - "minLength": 1 - }, - "unitSymbol": { - "type": "string", - "minLength": 1 - }, - "definition": { - "type": "array", - "items": { - "$ref": "#/definitions/LangString" - }, - "minItems": 1 - }, - "siNotation": { - "type": "string", - "minLength": 1 - }, - "siName": { - "type": "string", - "minLength": 1 - }, - "dinNotation": { - "type": "string", - "minLength": 1 - }, - "eceName": { - "type": "string", - "minLength": 1 - }, - "eceCode": { - "type": "string", - "minLength": 1 - }, - "nistName": { - "type": "string", - "minLength": 1 - }, - "sourceOfDefinition": { - "type": "string", - "minLength": 1 - }, - "conversionFactor": { - "type": "string", - "minLength": 1 - }, - "registrationAuthorityId": { - "type": "string", - "minLength": 1 }, - "supplier": { - "type": "string", - "minLength": 1 + "modelType": { + "const": "DataSpecificationIec61360" } }, "required": [ - "unitName", - "unitSymbol", - "definition" + "preferredName" ] } ] @@ -380,8 +445,6 @@ "xs:byte", "xs:date", "xs:dateTime", - "xs:dateTimeStamp", - "xs:dayTimeDuration", "xs:decimal", "xs:double", "xs:duration", @@ -405,11 +468,10 @@ "xs:unsignedByte", "xs:unsignedInt", "xs:unsignedLong", - "xs:unsignedShort", - "xs:yearMonthDuration" + "xs:unsignedShort" ] }, - "DataTypeIEC61360": { + "DataTypeIec61360": { "type": "string", "enum": [ "BLOB", @@ -447,7 +509,7 @@ "$ref": "#/definitions/Reference" }, "dataSpecificationContent": { - "$ref": "#/definitions/DataSpecificationContent" + "$ref": "#/definitions/DataSpecificationContent_choice" } }, "required": [ @@ -465,7 +527,7 @@ "statements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 }, @@ -473,10 +535,20 @@ "$ref": "#/definitions/EntityType" }, "globalAssetId": { - "$ref": "#/definitions/Reference" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + "specificAssetIds": { + "type": "array", + "items": { + "$ref": "#/definitions/SpecificAssetId" + }, + "minItems": 1 }, - "specificAssetId": { - "$ref": "#/definitions/SpecificAssetId" + "modelType": { + "const": "Entity" } }, "required": [ @@ -538,18 +610,20 @@ }, "topic": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 255, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "subjectId": { "$ref": "#/definitions/Reference" }, "timeStamp": { "type": "string", - "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)Z$" + "pattern": "^-?(([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9]))-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01]))T(((([01][0-9])|(2[0-3])):[0-5][0-9]:([0-5][0-9])(\\.[0-9]+)?)|24:00:00(\\.0+)?)(Z|\\+00:00|-00:00)$" }, "payload": { "type": "string", - "minLength": 1 + "contentEncoding": "base64" } }, "required": [ @@ -567,7 +641,9 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -576,7 +652,11 @@ "type": "string" }, "refersTo": { - "$ref": "#/definitions/Reference" + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + }, + "minItems": 1 } }, "required": [ @@ -594,13 +674,36 @@ "properties": { "value": { "type": "string", - "minLength": 1, - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] + }, + "modelType": { + "const": "File" } }, "required": [ @@ -637,7 +740,7 @@ "type": "object", "properties": { "kind": { - "$ref": "#/definitions/ModelingKind" + "$ref": "#/definitions/ModellingKind" } } }, @@ -668,7 +771,9 @@ }, "id": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } }, "required": [ @@ -685,7 +790,9 @@ }, "value": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" } }, "required": [ @@ -722,29 +829,97 @@ "SubmodelElementList" ] }, - "LangString": { + "LangStringDefinitionTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LangStringNameType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 128 + } + } + } + ] + }, + "LangStringPreferredNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 255 + } + } + } + ] + }, + "LangStringShortNameTypeIec61360": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 18 + } + } + } + ] + }, + "LangStringTextType": { + "allOf": [ + { + "$ref": "#/definitions/AbstractLangString" + }, + { + "properties": { + "text": { + "maxLength": 1023 + } + } + } + ] + }, + "LevelType": { "type": "object", "properties": { - "language": { - "type": "string", - "pattern": "^(([a-zA-Z]{2,3}(-[a-zA-Z]{3}(-[a-zA-Z]{3}){2})?|[a-zA-Z]{4}|[a-zA-Z]{5,8})(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-(([a-zA-Z0-9]){5,8}|[0-9]([a-zA-Z0-9]){3}))*(-[0-9A-WY-Za-wy-z](-([a-zA-Z0-9]){2,8})+)*(-[xX](-([a-zA-Z0-9]){1,8})+)?|[xX](-([a-zA-Z0-9]){1,8})+|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$" + "min": { + "type": "boolean" }, - "text": { - "type": "string" + "nom": { + "type": "boolean" + }, + "typ": { + "type": "boolean" + }, + "max": { + "type": "boolean" } }, "required": [ - "language", - "text" - ] - }, - "LevelType": { - "type": "string", - "enum": [ - "Max", - "Min", - "Nom", - "Typ" + "min", + "nom", + "typ", + "max" ] }, "ModelType": { @@ -756,8 +931,7 @@ "Blob", "Capability", "ConceptDescription", - "DataSpecificationIEC61360", - "DataSpecificationPhysicalUnit", + "DataSpecificationIec61360", "Entity", "File", "MultiLanguageProperty", @@ -771,7 +945,7 @@ "SubmodelElementList" ] }, - "ModelingKind": { + "ModellingKind": { "type": "string", "enum": [ "Instance", @@ -788,12 +962,15 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringTextType" }, "minItems": 1 }, "valueId": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "MultiLanguageProperty" } } } @@ -826,6 +1003,9 @@ "$ref": "#/definitions/OperationVariable" }, "minItems": 1 + }, + "modelType": { + "const": "Operation" } } } @@ -835,7 +1015,7 @@ "type": "object", "properties": { "value": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" } }, "required": [ @@ -857,6 +1037,9 @@ }, "valueId": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "Property" } }, "required": [ @@ -895,7 +1078,9 @@ }, "type": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueType": { "$ref": "#/definitions/DataTypeDefXsd" @@ -937,6 +1122,9 @@ }, "max": { "type": "string" + }, + "modelType": { + "const": "Range" } }, "required": [ @@ -954,31 +1142,39 @@ "properties": { "category": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 128, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "idShort": { "type": "string", - "maxLength": 128, - "pattern": "^[a-zA-Z][a-zA-Z0-9_]+$" + "allOf": [ + { + "minLength": 1, + "maxLength": 128 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$" + } + ] }, "displayName": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringNameType" }, "minItems": 1 }, "description": { "type": "array", "items": { - "$ref": "#/definitions/LangString" + "$ref": "#/definitions/LangStringTextType" }, "minItems": 1 }, - "checksum": { - "type": "string", - "minLength": 1 - }, "modelType": { "$ref": "#/definitions/ModelType" } @@ -1020,6 +1216,9 @@ "properties": { "value": { "$ref": "#/definitions/Reference" + }, + "modelType": { + "const": "ReferenceElement" } } } @@ -1028,11 +1227,25 @@ "ReferenceTypes": { "type": "string", "enum": [ - "GlobalReference", + "ExternalReference", "ModelReference" ] }, "RelationshipElement": { + "allOf": [ + { + "$ref": "#/definitions/RelationshipElement_abstract" + }, + { + "properties": { + "modelType": { + "const": "RelationshipElement" + } + } + } + ] + }, + "RelationshipElement_abstract": { "allOf": [ { "$ref": "#/definitions/SubmodelElement" @@ -1053,18 +1266,48 @@ } ] }, + "RelationshipElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/RelationshipElement" + }, + { + "$ref": "#/definitions/AnnotatedRelationshipElement" + } + ] + }, "Resource": { "type": "object", "properties": { "path": { "type": "string", - "minLength": 1, - "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + "allOf": [ + { + "minLength": 1, + "maxLength": 2000 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^file:(//((localhost|(\\[((([0-9A-Fa-f]{1,4}:){6}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|::([0-9A-Fa-f]{1,4}:){5}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|([0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){4}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){3}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){2}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:){2}([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){4}[0-9A-Fa-f]{1,4})?::([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))|(([0-9A-Fa-f]{1,4}:){5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(([0-9A-Fa-f]{1,4}:){6}[0-9A-Fa-f]{1,4})?::)|[vV][0-9A-Fa-f]+\\.([a-zA-Z0-9\\-._~]|[!$&'()*+,;=]|:)+)\\]|([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=])*)))?/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?|/((([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))+(/(([a-zA-Z0-9\\-._~]|%[0-9A-Fa-f][0-9A-Fa-f]|[!$&'()*+,;=]|[:@]))*)*)?)$" + } + ] }, "contentType": { "type": "string", - "minLength": 1, - "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \t]*;[ \t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\t !#-\\[\\]-~]|[\\x80-\\xff])|\\\\([\t !-~]|[\\x80-\\xff]))*\"))*$" + "allOf": [ + { + "minLength": 1, + "maxLength": 100 + }, + { + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" + }, + { + "pattern": "^([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+/([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+([ \\t]*;[ \\t]*([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+=(([!#$%&'*+\\-.^_`|~0-9a-zA-Z])+|\"(([\\t !#-\\[\\]-~]|[\u0080-\u00ff])|\\\\([\\t !-~]|[\u0080-\u00ff]))*\"))*$" + } + ] } }, "required": [ @@ -1080,11 +1323,15 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 64, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "value": { "type": "string", - "minLength": 1 + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "externalSubjectId": { "$ref": "#/definitions/Reference" @@ -1092,8 +1339,7 @@ }, "required": [ "name", - "value", - "externalSubjectId" + "value" ] } ] @@ -1127,9 +1373,12 @@ "submodelElements": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "Submodel" } } } @@ -1140,9 +1389,6 @@ { "$ref": "#/definitions/Referable" }, - { - "$ref": "#/definitions/HasKind" - }, { "$ref": "#/definitions/HasSemantics" }, @@ -1164,9 +1410,12 @@ "value": { "type": "array", "items": { - "$ref": "#/definitions/SubmodelElement" + "$ref": "#/definitions/SubmodelElement_choice" }, "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementCollection" } } } @@ -1182,13 +1431,6 @@ "orderRelevant": { "type": "boolean" }, - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/SubmodelElement" - }, - "minItems": 1 - }, "semanticIdListElement": { "$ref": "#/definitions/Reference" }, @@ -1197,6 +1439,16 @@ }, "valueTypeListElement": { "$ref": "#/definitions/DataTypeDefXsd" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/SubmodelElement_choice" + }, + "minItems": 1 + }, + "modelType": { + "const": "SubmodelElementList" } }, "required": [ @@ -1205,6 +1457,52 @@ } ] }, + "SubmodelElement_choice": { + "oneOf": [ + { + "$ref": "#/definitions/RelationshipElement" + }, + { + "$ref": "#/definitions/AnnotatedRelationshipElement" + }, + { + "$ref": "#/definitions/BasicEventElement" + }, + { + "$ref": "#/definitions/Blob" + }, + { + "$ref": "#/definitions/Capability" + }, + { + "$ref": "#/definitions/Entity" + }, + { + "$ref": "#/definitions/File" + }, + { + "$ref": "#/definitions/MultiLanguageProperty" + }, + { + "$ref": "#/definitions/Operation" + }, + { + "$ref": "#/definitions/Property" + }, + { + "$ref": "#/definitions/Range" + }, + { + "$ref": "#/definitions/ReferenceElement" + }, + { + "$ref": "#/definitions/SubmodelElementCollection" + }, + { + "$ref": "#/definitions/SubmodelElementList" + } + ] + }, "ValueList": { "type": "object", "properties": { @@ -1224,7 +1522,10 @@ "type": "object", "properties": { "value": { - "type": "string" + "type": "string", + "minLength": 1, + "maxLength": 2000, + "pattern": "^([\\t\\n\\r -\ud7ff\ue000-\ufffd]|\\ud800[\\udc00-\\udfff]|[\\ud801-\\udbfe][\\udc00-\\udfff]|\\udbff[\\udc00-\\udfff])*$" }, "valueId": { "$ref": "#/definitions/Reference" diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index f42b06cfd..8f70a124a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,48 +17,44 @@ import static org.junit.Assert.assertEquals; -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.junit.Assert; +import org.junit.Test; public class JsonDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonDeserializerTest.class); - @Test public void testReadFromFile() throws Exception { - new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); + new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); } @Test public void testSimpleExample() throws Exception { - Environment env = new JsonDeserializer().read(JsonSerializerTest.AASSIMPLE_FILE); - Assert.assertEquals(AASSimple.ENVIRONMENT, env); + Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); + Assert.assertEquals(expected, actual); } @Test public void testFullExample() throws Exception { - Environment env = new JsonDeserializer().read(JsonSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.ENVIRONMENT, env); + Environment expected = Examples.EXAMPLE_FULL.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + Assert.assertEquals(expected, actual); } @Test public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.ENVIRONMENT); - Deserializer deserializer = new JsonDeserializer(); + String json = new JsonSerializer().write(AASSimple.createEnvironment()); + JsonDeserializer deserializer = new JsonDeserializer(); Environment environment = deserializer.read(json); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 4d32ad062..68ef1d473 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,119 +17,84 @@ import static org.junit.Assert.assertEquals; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.util.Arrays; +import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); - @Test public void testReadAAS() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); - - assertEquals(aasExpected, aas); + AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); + AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadAASs() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); - String expected = Files.readString(fileExpected.toPath()); - List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) - ,environment.getAssetAdministrationShells().get(1)) ; - - assertEquals(aasExpected, aas); + List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodel.json"); - String expected = Files.readString(fileExpected.toPath()); - Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - Submodel submodelExpected = environment.getSubmodels().get(0); - - assertEquals(submodelExpected, submodel); + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelList.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); - - assertEquals(submodelsExpected, submodels); + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElement.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); - - assertEquals(submodelElementExpected, submodelElement); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); + SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelElementsExpected = Arrays.asList( - environment.getSubmodels().get(0).getSubmodelElements().get(0), - environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; - - assertEquals(submodelElementsExpected, submodelElements); + List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementList.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; - - assertEquals(submodelElementListExpected, submodelElementList); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); + SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementCollection.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; - - assertEquals(submodelElementCollectionExpected, submodelElementCollection); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); + SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + assertEquals(expected, actual); } + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); + assertEquals(emptyList, deserialized); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 43fcec6f6..7df276487 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,125 +15,92 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.sql.Ref; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import java.util.Collection; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; +import org.junit.Ignore; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; - -import static org.junit.Assert.assertTrue; public class JsonReferableSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableSerializerTest.class); - @Test public void testSerializeAAS() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell assetAdministrationShell = environment.getAssetAdministrationShells().get(0); - compare("src/test/resources/assetAdministrationShell.json",assetAdministrationShell); + compare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testSerializeAASs() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - compare("src/test/resources/assetAdministrationShellList.json", - environment.getAssetAdministrationShells().get(0), environment.getAssetAdministrationShells().get(1)); + public void testSerializeWithAssetInformation() throws SerializationException, JSONException, IOException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); } @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - Submodel submodel = environment.getSubmodels().get(0); - compare("src/test/resources/submodel.json",submodel); + public void testSerializeAASs() throws IOException, SerializationException, JSONException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - compare("src/test/resources/submodelList.json", environment.getSubmodels().get(0), environment.getSubmodels().get(1)); + @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") + public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { + compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } @Test - public void testSerializeSubmodelAsReferable() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - - List submodels = new ArrayList<>(); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(0)); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(1)); - submodels.add(AASFull.ENVIRONMENT.getSubmodels().get(2)); - - String serializedReferenceArray = serializer.writeReferables(submodels); + public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL); + } - assertTrue(serializedReferenceArray.contains("\"http://acplt.org/Submodels/Assets/TestAsset/Identification\"")); + @Test + public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElement = environment.getSubmodels().get(0).getSubmodelElements().get(0); - compare("src/test/resources/submodelElement.json",submodelElement); + compare(Examples.SUBMODEL_ELEMENT); } @Test public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElement0 = environment.getSubmodels().get(0).getSubmodelElements().get(0); - SubmodelElement submodelElement1 = environment.getSubmodels().get(0).getSubmodelElements().get(1); - compare("src/test/resources/listOfSubmodelElements.json",submodelElement0,submodelElement1); + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElementCollection submodelElementCollection = (SubmodelElementCollection) environment.getSubmodels().get(6).getSubmodelElements().get(6); - compare("src/test/resources/submodelElementCollection.json",submodelElementCollection); + compare(Examples.SUBMODEL_ELEMENT_COLLECTION); } @Test public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - Environment environment = AASFull.ENVIRONMENT; - SubmodelElementList submodelElementList = (SubmodelElementList) environment.getSubmodels().get(6).getSubmodelElements().get(5); - compare("src/test/resources/submodelElementList.json",submodelElementList); + compare(Examples.SUBMODEL_ELEMENT_LIST); } @Test public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare("src/test/resources/submodelElementListEmpty.json", - new DefaultSubmodelElementList.Builder() - .idShort("submodelElementList") - .orderRelevant(true) - .build()); + compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); } - private void compare(String filePathForExpected, Referable... referable) throws IOException, SerializationException, JSONException { - File fileExpected = new File(filePathForExpected); - String expected = Files.readString(fileExpected.toPath()); - String actual; - if(referable.length>1){ - actual = new JsonSerializer().writeReferables(List.of(referable)); - } else { - actual = new JsonSerializer().writeReferable(Arrays.stream(referable).findFirst().get()); + @SuppressWarnings("unchecked") + private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { + String expected = exampleData.fileContent(); + String actual = null; + if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = new JsonSerializer().write((Environment) exampleData.getModel()); + } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = new JsonSerializer().write((Referable) exampleData.getModel()); + } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) + && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { + actual = new JsonSerializer().write((Collection) exampleData.getModel()); } - logger.info(actual); - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 40f49d167..1ea73393e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +20,16 @@ import java.io.File; import java.io.IOException; -import java.nio.file.Files; +import java.util.Collections; +import java.util.List; import java.util.Set; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; import org.junit.Rule; import org.junit.Test; @@ -37,13 +41,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; - public class JsonSerializerTest { - public static final java.io.File AASSIMPLE_FILE = new java.io.File("src/test/resources/jsonExample.json"); - public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.json"); private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); @@ -58,28 +56,35 @@ public void testSerializeNull() throws JsonProcessingException, IOException, Ser @Test public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.ENVIRONMENT); + new JsonSerializer().write(file, AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { - validateAndCompare(new java.io.File("src/test/resources/empty_aas.json"), new DefaultEnvironment.Builder().build()); + validateAndCompare(Examples.ENVIRONMENT_EMPTY); } @Test public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { - validateAndCompare(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); + validateAndCompare(Examples.EXAMPLE_SIMPLE); } @Test public void testSerializeFullExample() throws SerializationException, JSONException, IOException { - validateAndCompare(AASFULL_FILE, AASFull.ENVIRONMENT); + validateAndCompare(Examples.EXAMPLE_FULL); } - private void validateAndCompare(File expectedFile, Environment environment) throws IOException, SerializationException, JSONException { - String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().write(environment); + @Test + public void testSerializeEmptyReferableList() throws SerializationException { + List emptyList = Collections.emptyList(); + String serialized = new JsonSerializer().write(emptyList); + assertEquals("[]", serialized); + } + + private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { + String expected = exampleData.fileContent(); + String actual = new JsonSerializer().write(exampleData.getModel()); logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java index f9878057f..ed0e9b08e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -30,6 +28,7 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; +import static org.junit.Assert.assertFalse; @RunWith(JUnitParamsRunner.class) public class JsonValidationTest { @@ -43,28 +42,27 @@ public static void prepareValidator() throws IOException { @Test @Parameters({ - "src/test/resources/empty_aas.json", - "src/test/resources/jsonExample.json", + "src/test/resources/Environment-Empty.json", + "src/test/resources/Example-Simple.json", "src/test/resources/MotorAAS.json", - "src/test/resources/MotorAAS_reduced.json", - "src/test/resources/test_demo_full_example.json" + "src/test/resources/MotorAAS-Reduced.json", + "src/test/resources/Example-Full.json" }) public void validateValidJson(String file) throws IOException { - String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); - Set errors = validator.validateSchema(serializedEnvironment); - System.out.println("Validating: " + file); - assertTrue(errors.isEmpty()); + assertTrue(validate(file).isEmpty()); } @Test - @Parameters({"src/test/resources/invalidJsonExample.json"}) + @Parameters({"src/test/resources/Environment-Invalid.json"}) public void validateInvalidJson(String file) throws IOException { - String serializedEnvironment = new String(Files.readAllBytes(Paths.get(file))); - Set errors = validator.validateSchema(serializedEnvironment); + assertFalse(validate(file).isEmpty()); + } + + private Set validate(String file) throws IOException { + String json = new String(Files.readAllBytes(Paths.get(file))); + Set result = validator.validateSchema(json); System.out.println("Validating: " + file); - for (String s : errors) { - System.out.println(s); - } - assertEquals(2, errors.size()); + result.forEach(System.out::println); + return result; } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index 4b677e6ca..a020dd4a9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +27,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-json/src/test/resources/AssetAdministrationShell.json b/dataformat-json/src/test/resources/AssetAdministrationShell.json index dca5615c6..aa9b84207 100644 --- a/dataformat-json/src/test/resources/AssetAdministrationShell.json +++ b/dataformat-json/src/test/resources/AssetAdministrationShell.json @@ -1,73 +1,64 @@ -{ - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ], - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell", - "administration": - { - "version": "0.9", - "revision": "0" - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "GlobalReference" - }, - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "GlobalReference" - } - ] -} \ No newline at end of file +{ + "idShort": "TestAssetAdministrationShell", + "description": [ + { + "language": "en-us", + "text": "An Example Asset Administration Shell for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" + } + ], + "modelType": "AssetAdministrationShell", + "id": "https://acplt.org/Test_AssetAdministrationShell", + "administration": + { + "version": "0", + "revision": "9" + }, + "derivedFrom": + { + "keys": [ + { + "type": "AssetAdministrationShell", + "value": "https://acplt.org/TestAssetAdministrationShell2" + } + ], + "type": "ExternalReference" + }, + "assetInformation": + { + "assetKind": "Instance", + "globalAssetId":"https://acplt.org/Test_Asset" + }, + "submodels": [ + { + "keys": [ + { + "type": "Submodel", + "value": "https://acplt.org/Test_Submodel" + } + ], + "type": "ExternalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" + } + ], + "type": "ExternalReference" + }, + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" + } + ], + "type": "ExternalReference" + } + ] +} diff --git a/dataformat-json/src/test/resources/MotorAAS.json b/dataformat-json/src/test/resources/MotorAAS.json index f1207e299..b0b828a79 100644 --- a/dataformat-json/src/test/resources/MotorAAS.json +++ b/dataformat-json/src/test/resources/MotorAAS.json @@ -6,15 +6,7 @@ "id": "http://customer.com/aas/9175_7013_7091_9168", "assetInformation": { "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "http://customer.com/assets/KHBVZJSQKIY" - } - ], - "type": "GlobalReference" - }, + "globalAssetId": "http://customer.com/assets/KHBVZJSQKIY", "specificAssetIds": [ { "name": "EquipmentID", @@ -26,7 +18,7 @@ "value": "http://customer.com/Systems/ERP/012" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, { @@ -39,13 +31,12 @@ "value": "http://customer.com/Systems/IoT/1" } ], - "type": "GlobalReference" + "type": "ExternalReference" } } ], "thumbnail": { "modelType": "File", - "kind": "Instance", "idShort": "thumbnail", "mimeType": "image/png", "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" @@ -59,7 +50,7 @@ "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -68,7 +59,7 @@ "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -77,7 +68,7 @@ "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] } @@ -92,7 +83,7 @@ "value": "0173-1#01-AFZ615#016" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "kind": "Instance", "idShort": "TechnicalData", @@ -100,7 +91,6 @@ "submodelElements": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -108,7 +98,7 @@ "value": "0173-1#02-BAA120#008" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "MaxRotationSpeed", "category": "PARAMETER", @@ -125,7 +115,6 @@ "submodelElements": [ { "modelType": "SubmodelElementCollection", - "kind": "Instance", "semanticId": { "keys": [ { @@ -133,13 +122,12 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "OperatingManual", "value": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -147,15 +135,14 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "Title", "value": "OperatingManual", - "valueType": "langString" + "valueType": "xs:string" }, { "modelType": "File", - "kind": "Instance", "semanticId": { "keys": [ { @@ -163,11 +150,11 @@ "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "DigitalFile_PDF", "contentType": "application/pdf", - "value": "/aasx/OperatingManual.pdf" + "value": "file:///aasx/OperatingManual.pdf" } ], "ordered": false, @@ -183,7 +170,6 @@ "submodelElements": [ { "modelType": "Property", - "kind": "Instance", "semanticId": { "keys": [ { @@ -191,7 +177,7 @@ "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "idShort": "RotationSpeed", "category": "Variable", @@ -215,10 +201,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "EN", @@ -229,7 +215,7 @@ "text": "Titel" } ], - "shortNames": [ + "shortName": [ { "language": "EN", "text": "Title" @@ -239,9 +225,7 @@ "text": "Titel" } ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "StringTranslatable", + "dataType": "STRING_TRANSLATABLE", "definition": [ { "language": "DE", @@ -265,10 +249,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "EN", @@ -279,7 +263,7 @@ "text": "DigitaleDatei" } ], - "shortNames": [ + "shortName": [ { "language": "EN", "text": "DigitalFile" @@ -289,9 +273,7 @@ "text": "DigitaleDatei" } ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "String", + "dataType": "STRING", "definition": [ { "language": "DE", @@ -320,10 +302,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "de", @@ -334,7 +316,6 @@ "text": "Max.rotationspeed" } ], - "shortNames": [], "unit": "1/min", "unitId": { "keys": [ @@ -343,10 +324,9 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", + "dataType": "REAL_MEASURE", "definition": [ { "language": "de", @@ -375,10 +355,10 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", + "modelType": "DataSpecificationIec61360", "preferredName": [ { "language": "DE", @@ -389,14 +369,14 @@ "text": "Actualrotationspeed" } ], - "shortNames": [ + "shortName": [ { "language": "DE", "text": "AktuelleDrehzahl" }, { "language": "EN", - "text": "ActualRotationSpeed" + "text": "ActRotationSpeed" } ], "unit": "1/min", @@ -407,10 +387,9 @@ "value": "0173-1#05-AAA650#002" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", + "dataType": "REAL_MEASURE", "definition": [ { "language": "DE", @@ -438,12 +417,17 @@ "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [], - "shortNames": [ + "modelType": "DataSpecificationIec61360", + "preferredName": [ + { + "language": "DE", + "text": "Dokument" + } + ], + "shortName": [ { "language": "EN", "text": "Document" @@ -453,9 +437,8 @@ "text": "Dokument" } ], - "unit": "", "sourceOfDefinition": "[ISO15519-1:2010]", - "dataType": "String", + "dataType": "STRING", "definition": [ { "language": "DE", diff --git a/dataformat-json/src/test/resources/Submodel.json b/dataformat-json/src/test/resources/Submodel.json index 79a85f8cc..c3751c085 100644 --- a/dataformat-json/src/test/resources/Submodel.json +++ b/dataformat-json/src/test/resources/Submodel.json @@ -1,124 +1,144 @@ - -{ - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "category": "VARIABLE", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - }, - { - "modelType": "Property", - "category": "VARIABLE", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] -} \ No newline at end of file + +{ + "modelType": "Submodel", + "kind": "Instance", + "semanticId": + { + "keys": [ + { + "type": "Submodel", + "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" + } + ], + "type": "ExternalReference" + }, + "administration": + { + "revision": "9", + "version": "0" + }, + "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", + "idShort": "Identification", + "submodelElements": [ + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "ExternalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ], + "displayName": [ + { + "language": "en-us", + "text": "Manufacturer Name" + } + ] + }, + { + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" + } + ], + "type": "ExternalReference" + }, + "value": "978-8234-234-342", + "supplementalSemanticIds": [ + { + "keys": [ + { + "type": "GlobalReference", + "value": "something_random_e14ad770" + } + ], + "type": "ExternalReference" + }, + { + "keys": [{ + "type": "GlobalReference", + "value": "something_random_bd061acd" + }], + "type": "ExternalReference" + } + + ], + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "978-8234-234-342" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "category": "VARIABLE", + "idShort": "InstanceId", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ] + } + ], + "description": [ + { + "language": "en-us", + "text": "An example asset identification submodel for the test application" + }, + { + "language": "de", + "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" + } + ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElement.json b/dataformat-json/src/test/resources/SubmodelElement.json index aa25cb3d2..fb11778ca 100644 --- a/dataformat-json/src/test/resources/SubmodelElement.json +++ b/dataformat-json/src/test/resources/SubmodelElement.json @@ -1,53 +1,55 @@ - -{ - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] -} \ No newline at end of file + +{ + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "0173-1#02-AAO677#002" + } + ], + "type": "ExternalReference" + }, + "value": "http://acplt.org/ValueId/ACPLT", + "valueId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/ValueId/ACPLT" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string", + "qualifiers": [ + { + "type": "http://acplt.org/Qualifier/ExampleQualifier", + "value": "100", + "valueType": "xs:int" + }, + { + "type": "http://acplt.org/Qualifier/ExampleQualifier2", + "value": "50", + "valueType": "xs:int" + } + ], + "idShort": "ManufacturerName", + "description": [ + { + "language": "en-us", + "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." + }, + { + "language": "de", + "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" + } + ], + "displayName": [ + { + "language": "en-us", + "text": "Manufacturer Name" + } + ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElementCollection.json b/dataformat-json/src/test/resources/SubmodelElementCollection.json index 981979de9..f0366f0f9 100644 --- a/dataformat-json/src/test/resources/SubmodelElementCollection.json +++ b/dataformat-json/src/test/resources/SubmodelElementCollection.json @@ -1,86 +1,82 @@ -{ - "idShort": "ExampleSubmodelElementCollection", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "modelType": "SubmodelElementCollection", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "value": [ { - "modelType" : "Blob", - "contentType" : "application/pdf", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Blobs/ExampleBlob" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Blob object" - }, { - "language" : "de", - "text" : "Beispiel Blob Element" - } ], - "idShort" : "ExampleBlob" - }, { - "modelType" : "File", - "contentType" : "application/pdf", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/Files/ExampleFile" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example File object" - }, { - "language" : "de", - "text" : "Beispiel File Element" - } ], - "idShort" : "ExampleFile" - }, { - "modelType" : "ReferenceElement", - "kind" : "Template", - "semanticId" : { - "keys" : [ { - "type" : "GlobalReference", - "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } ], - "type" : "GlobalReference" - }, - "category" : "PARAMETER", - "description" : [ { - "language" : "en-us", - "text" : "Example Reference Element object" - }, { - "language" : "de", - "text" : "Beispiel Reference Element Element" - } ], - "idShort" : "ExampleReferenceElement" - } ] -} \ No newline at end of file +{ + "idShort": "ExampleSubmodelElementCollection", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementCollection object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementCollection Element" + } + ], + "modelType": "SubmodelElementCollection", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" + } + ], + "type": "ExternalReference" + }, + "value": [ { + "modelType" : "Blob", + "contentType" : "application/pdf", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Blobs/ExampleBlob" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Blob object" + }, { + "language" : "de", + "text" : "Beispiel Blob Element" + } ], + "idShort" : "ExampleBlob" + }, { + "modelType" : "File", + "contentType" : "application/pdf", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/Files/ExampleFile" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example File object" + }, { + "language" : "de", + "text" : "Beispiel File Element" + } ], + "idShort" : "ExampleFile" + }, { + "modelType" : "ReferenceElement", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "http://acplt.org/ReferenceElements/ExampleReferenceElement" + } ], + "type": "ExternalReference" + }, + "category" : "PARAMETER", + "description" : [ { + "language" : "en-us", + "text" : "Example Reference Element object" + }, { + "language" : "de", + "text" : "Beispiel Reference Element Element" + } ], + "idShort" : "ExampleReferenceElement" + } ] +} diff --git a/dataformat-json/src/test/resources/SubmodelElementList.json b/dataformat-json/src/test/resources/SubmodelElementList.json index 7456c61c1..fc5dd9c06 100644 --- a/dataformat-json/src/test/resources/SubmodelElementList.json +++ b/dataformat-json/src/test/resources/SubmodelElementList.json @@ -1,141 +1,136 @@ -{ - "idShort": "ExampleSubmodelElementListOrdered", - "category": "PARAMETER", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "modelType": "SubmodelElementList", - "orderRelevant": true, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "typeValueListElement": "SubmodelElement", - "value": [ - { - "idShort": "ExampleProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ], - "modelType": "Property", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:string" - }, - { - "idShort": "ExampleMultiLanguageProperty", - "category": "CONSTANT", - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ], - "modelType": "MultiLanguageProperty", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "kind": "Template" - }, - { - "idShort": "ExampleRange", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:int", - "max": "100" - }, - { - "idShort": "ExampleRange2", - "category": "PARAMETER", - "description": - [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ], - "modelType": "Range", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "valueType": "xs:int", - "min": "0" - } - ] -} \ No newline at end of file +{ + "idShort": "ExampleSubmodelElementListOrdered", + "category": "PARAMETER", + "description": [ + { + "language": "en-us", + "text": "Example SubmodelElementListOrdered object" + }, + { + "language": "de", + "text": "Beispiel SubmodelElementListOrdered Element" + } + ], + "modelType": "SubmodelElementList", + "orderRelevant": true, + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" + } + ], + "type": "ExternalReference" + }, + "typeValueListElement": "SubmodelElement", + "value": [ + { + "idShort": "ExampleProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example Property object" + }, + { + "language": "de", + "text": "Beispiel Property Element" + } + ], + "modelType": "Property", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Properties/ExampleProperty" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:string" + }, + { + "idShort": "ExampleMultiLanguageProperty", + "category": "CONSTANT", + "description": [ + { + "language": "en-us", + "text": "Example MultiLanguageProperty object" + }, + { + "language": "de", + "text": "Beispiel MultiLanguageProperty Element" + } + ], + "modelType": "MultiLanguageProperty", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" + } + ], + "type": "ExternalReference" + } + }, + { + "idShort": "ExampleRange", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:int", + "max": "100" + }, + { + "idShort": "ExampleRange2", + "category": "PARAMETER", + "description": + [ + { + "language": "en-us", + "text": "Example Range object" + }, + { + "language": "de", + "text": "Beispiel Range Element" + } + ], + "modelType": "Range", + "semanticId": + { + "keys": [ + { + "type": "GlobalReference", + "value": "http://acplt.org/Ranges/ExampleRange" + } + ], + "type": "ExternalReference" + }, + "valueType": "xs:int", + "min": "0" + } + ] +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index cdbafe570..42ec3687b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,37 +15,54 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -public class XmlDeserializer implements Deserializer { +public class XmlDeserializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + @SuppressWarnings("rawtypes") + protected static Map, JsonDeserializer> customDeserializers = Map.of( SubmodelElement.class, new SubmodelElementDeserializer()); + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + + public XmlDeserializer() { + this(new XmlFactory()); + } + + public XmlDeserializer(XmlFactory xmlFactory) { + this.xmlFactory = xmlFactory; initTypeResolver(); buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder().enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + mapper = XmlMapper.builder(xmlFactory) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .serializationInclusion(JsonInclude.Include.NON_NULL) .annotationIntrospector(new XmlDataformatAnnotationIntrospector()) @@ -63,7 +79,8 @@ protected SimpleModule buildCustomDeserializerModule() { return module; } - private void initTypeResolver() { + @SuppressWarnings("unchecked") + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() @@ -83,7 +100,15 @@ protected SimpleModule buildImplementationModule() { return module; } - @Override + /** + * Deserializes a given string into an instance of + * AssetAdministrationShellEnvironment + * + * @param value a string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ public Environment read(String value) throws DeserializationException { try { return mapper.readValue(value, Environment.class); @@ -92,7 +117,82 @@ public Environment read(String value) throws DeserializationException { } } - @Override + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src) throws DeserializationException { + return read(src, DEFAULT_CHARSET); + } + + + /** + * Deserializes a given InputStream into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param src An InputStream containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws DeserializationException if deserialization fails + */ + public Environment read(InputStream src, Charset charset) throws DeserializationException { + return read(new BufferedReader( + new InputStreamReader(src, charset)) + .lines() + .collect(Collectors.joining(System.lineSeparator()))); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * + * @param file A java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @param charset the charset to use for deserialization + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file, Charset charset) + throws FileNotFoundException, DeserializationException { + return read(new FileInputStream(file), charset); + } + + /** + * Deserializes a given File into an instance of + * AssetAdministrationShellEnvironment using a given charset + * + * @param file a java.io.File containing the string representation of the + * AssetAdministrationShellEnvironment + * @return an instance of AssetAdministrationShellEnvironment + * @throws FileNotFoundException if the file is not present + * @throws DeserializationException if deserialization fails + */ + public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + return read(file, DEFAULT_CHARSET); + } + + /** + * Enables usage of custom implementation to be used for deserialization + * instead of default implementation, e.g. defining a custom implementation + * of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will + * result in all instances of Submodel will be deserialized as + * CustomSubmodel. Subsequent class with the same aasInterface parameter + * will override the effects of all previous calls. + * + * @param the type of the interface to replace + * @param aasInterface the class of the interface to replace + * @param implementation the class implementing the interface that should be + * used for deserialization. + */ public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index 419f9632a..e7b28aafa 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,19 +15,18 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.*; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Map; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.OperationVariableSerializer; -// TODO import io.adminshell.aas.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import com.fasterxml.jackson.annotation.JsonInclude; @@ -37,25 +35,34 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -public class XmlSerializer implements Serializer { +public class XmlSerializer { + protected final XmlFactory xmlFactory; protected XmlMapper mapper; protected Map namespacePrefixes; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + public XmlSerializer() { this(null); } public XmlSerializer(Map namespacePrefixes) { + this(new XmlFactory(), namespacePrefixes); + } + + public XmlSerializer(XmlFactory xmlFactory, Map namespacePrefixes) { + this.xmlFactory = xmlFactory; this.namespacePrefixes = namespacePrefixes; buildMapper(); } protected void buildMapper() { - mapper = XmlMapper.builder() + mapper = XmlMapper.builder(xmlFactory) .enable(SerializationFeature.INDENT_OUTPUT) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) @@ -70,7 +77,6 @@ protected void buildMapper() { protected SimpleModule buildCustomSerializerModule() { SimpleModule module = new SimpleModule(); - // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); AssetAdministrationShellEnvironmentSerializer aasEnvSerializer; if (namespacePrefixes != null) { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(namespacePrefixes); @@ -78,11 +84,7 @@ protected SimpleModule buildCustomSerializerModule() { aasEnvSerializer = new AssetAdministrationShellEnvironmentSerializer(); } module.addSerializer(Environment.class, aasEnvSerializer); -// module.addSerializer(Key.class, new KeySerializer()); -// module.addSerializer(Reference.class, new ReferenceSerializer()); - module.addSerializer(LangString.class, new LangStringSerializer()); -// module.addSerializer(new LangStringsSerializer()); -module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); + module.addSerializer(OperationVariable.class, new OperationVariableSerializer()); return module; } @@ -92,7 +94,15 @@ protected SimpleModule buildEnumModule() { return module; } - @Override + /** + * Serializes a given instance of AssetAdministrationShellEnvironment to + * string + * + * @param aasEnvironment the AssetAdministrationShellEnvironment to + * serialize + * @return the string representation of the environment + * @throws SerializationException if serialization fails + */ public String write(Environment aasEnvironment) throws SerializationException { try { ObjectWriter writer = mapper.writer(); @@ -101,4 +111,73 @@ public String write(Environment aasEnvironment) throws SerializationException { throw new SerializationException("serialization failed", ex); } } + + + /** + * Serializes a given instance of Environment to an + * OutputStream using DEFAULT_CHARSET + * + * @param out the Outputstream to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { + write(out, DEFAULT_CHARSET, aasEnvironment); + } + + /** + * Serializes a given instance of Environment to an + * OutputStream using given charset + * + * @param out the Outputstream to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws IOException if writing to the stream fails + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Charset charset, Environment aasEnvironment) + throws IOException, SerializationException { + try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { + writer.write(write(aasEnvironment)); + } + } + + // Note that the AAS also defines a file class + /** + * Serializes a given instance of Environment to a + * java.io.File using DEFAULT_CHARSET + * + * @param file the java.io.File to serialize to + * @param charset the Charset to use for serialization + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + try (OutputStream out = new FileOutputStream(file)) { + write(out, charset, aasEnvironment); + } + } + + /** + * Serializes a given instance of Environment to a + * java.io.File using given charset + * + * @param file the java.io.File to serialize to + * @param aasEnvironment the Environment to + * serialize + * @throws FileNotFoundException if the fail does not exist + * @throws IOException if writing to the file fails + * @throws SerializationException if serialization fails + */ + void write(java.io.File file, Environment aasEnvironment) + throws FileNotFoundException, IOException, SerializationException { + write(file, DEFAULT_CHARSET, aasEnvironment); + } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 45caad7c9..1deec93b2 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,29 +15,24 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +import java.io.IOException; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { -import java.io.IOException; -import java.util.Collections; -import java.util.List; - -// TODO fix the EmbeddedDataSpecification issue -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer> { + private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; @Override - public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -47,23 +41,14 @@ public List deserialize(JsonParser parser, Deserializa return createEmbeddedDataSpecificationsFromContent(parser, node); } - private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonMappingException { - if (!node.has(DataSpecificationManager.PROP_DATA_SPECIFICATION)) { - throw new JsonMappingException(parser, String.format("data specification must contain node '%s'", DataSpecificationManager.PROP_DATA_SPECIFICATION)); - } - JsonNode nodeDataSpecification = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION); - return nodeDataSpecification; - } - private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); - JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); - DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); - return Collections.singletonList(content); + private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); + return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); } - private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); + private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java index 42f255af0..94c505b12 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2022 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +import java.io.IOException; +import java.util.Collections; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -23,22 +29,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; public class OperationVariableDeserializer extends JsonDeserializer> { - - public OperationVariableDeserializer() { - } - - @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); @@ -60,7 +54,7 @@ public List deserialize(JsonParser parser, DeserializationCon private List createOperationVariablesFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("operationVariable"); - return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); + return DeserializationHelper.createInstancesFromArrayNode(parser, content, OperationVariable.class); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java index ce2d633ee..a1930c8ea 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java @@ -25,7 +25,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2022 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,10 +42,11 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -54,20 +55,12 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - public class QualifierDeserializer extends JsonDeserializer> { - - public QualifierDeserializer() { - } - - @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); - List qualifiers = new ArrayList<>(); if (!node.has("qualifier")) { return Collections.emptyList(); @@ -82,10 +75,9 @@ public List deserialize(JsonParser parser, DeserializationContext ctx } - @SuppressWarnings("unchecked") private List createConstraintsFromArrayNode(JsonParser parser, ObjectNode node) throws IOException { ArrayNode content = (ArrayNode) node.get("qualifier"); - return (List) DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); + return DeserializationHelper.createInstancesFromArrayNode(parser, content, Qualifier.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java index baac7da10..1fed0147e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +20,8 @@ import java.util.Collections; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -29,13 +30,12 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - public class ReferencesDeserializer extends JsonDeserializer> { @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); + treeNode = treeNode.get("reference"); if (treeNode.isArray()) { return createReferencesFromArray(parser, (ArrayNode) treeNode); } else { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java index 6a591795d..df65da5af 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +25,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class SubmodelElementDeserializer extends JsonDeserializer { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java index 4eae88d22..cad350fb0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +21,8 @@ import java.util.Iterator; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -33,8 +34,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - public class SubmodelElementsDeserializer extends JsonDeserializer> { private SubmodelElementDeserializer deserializer = new SubmodelElementDeserializer(); @@ -57,8 +56,7 @@ public List deserialize(JsonParser parser, DeserializationConte } private List createSubmodelElements(JsonParser parser, DeserializationContext ctxt, TreeNode treeNode) throws IOException, JsonProcessingException { -// JsonNode nodeSubmodelElement = getSubmodelElementsNode(treeNode); - if (treeNode.isArray()) { + if (treeNode.isArray()) { return getSubmodelElementsFromArrayNode(parser, ctxt, (ArrayNode) treeNode); } else { return getSubmodelElementsFromObjectNode(parser, ctxt, (JsonNode) treeNode); @@ -91,12 +89,6 @@ private List getSubmodelElementsFromObjectNode(JsonParser parse return submodelElements; } - private JsonNode getSubmodelElementsNode(TreeNode temp) { - ObjectNode objNode = (ObjectNode) temp; - JsonNode nodeSubmodelElement = objNode.get("submodelElement"); // TODO: most likely the node will have the name of a SME subclass, e.g. "property" and not "submodelElement" - return nodeSubmodelElement; - } - private List getSubmodelElementsFromArrayNode(JsonParser parser, DeserializationContext ctxt, ArrayNode arrayNode) throws IOException, JsonProcessingException { List elements = new ArrayList<>(); for (int i = 0; i < arrayNode.size(); i++) { @@ -109,8 +101,7 @@ private List getSubmodelElementsFromArrayNode(JsonParser parser private SubmodelElement getSubmodelElementFromJsonNode(JsonParser parser, DeserializationContext ctxt, JsonNode nodeSubmodelElement) throws IOException, JsonProcessingException { JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeSubmodelElement); - SubmodelElement elem = deserializer.deserialize(parserReference, ctxt); - return elem; + return deserializer.deserialize(parserReference, ctxt); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java new file mode 100644 index 000000000..05eded296 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/AasXmlNamespaceContext.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.HashMap; +import java.util.Map; + + +public class AasXmlNamespaceContext { + + public static final String AAS_PREFERRED_PREFIX = "aas"; + public static final String AAS_URI = "https://admin-shell.io/aas/3/0"; + + public static final String XSI_PREFERRED_PREFIX = "xsi"; + public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; + + public static final Map PREFERRED_PREFIX_CONTEXT = new HashMap<>(); + + static { + PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); + PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); + } + + private AasXmlNamespaceContext() { + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java new file mode 100644 index 000000000..dc4dbda68 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/SubmodelElementManager.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEventPayload; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; + +public class SubmodelElementManager { + + public static Map, String> CLASS_TO_NAME = new HashMap<>(); + public static Map> NAME_TO_CLASS = new HashMap<>(); + + static { + CLASS_TO_NAME.put(DefaultAnnotatedRelationshipElement.class, "annotatedRelationshipElement"); + CLASS_TO_NAME.put(DefaultRelationshipElement.class, "relationshipElement"); + CLASS_TO_NAME.put(DefaultReferenceElement.class, "referenceElement"); + CLASS_TO_NAME.put(DefaultProperty.class, "property"); + CLASS_TO_NAME.put(DefaultFile.class, "file"); + CLASS_TO_NAME.put(DefaultBlob.class, "blob"); + CLASS_TO_NAME.put(DefaultRange.class, "range"); + CLASS_TO_NAME.put(DefaultMultiLanguageProperty.class, "multiLanguageProperty"); + CLASS_TO_NAME.put(DefaultCapability.class, "capability"); + CLASS_TO_NAME.put(DefaultEntity.class, "entity"); + CLASS_TO_NAME.put(DefaultBasicEventElement.class, "basicEventElement"); + CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); + CLASS_TO_NAME.put(DefaultOperation.class, "operation"); + CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); + CLASS_TO_NAME.put(DefaultLangStringTextType.class, "langStringTextType"); + CLASS_TO_NAME.put(DefaultLangStringNameType.class, "langStringNameType"); + CLASS_TO_NAME.put(DefaultLangStringDefinitionTypeIec61360.class, "langStringDefinitionTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangStringPreferredNameTypeIec61360.class, "langStringPreferredNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultLangStringShortNameTypeIec61360.class, "langStringShortNameTypeIec61360"); + CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); + CLASS_TO_NAME.put(DefaultSubmodelElementList.class, "submodelElementList"); + NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); + } + + public static String getXmlName(Class type) { + return CLASS_TO_NAME.get(type); + } + + public static Class getClassByXmlName(String xmlName) { + return NAME_TO_CLASS.get(xmlName); + } + + private SubmodelElementManager() { + } +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java new file mode 100644 index 000000000..0b886d776 --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal; + +import java.util.Collection; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.cfg.MapperConfig; +import com.fasterxml.jackson.databind.introspect.Annotated; +import com.fasterxml.jackson.databind.introspect.AnnotatedClass; +import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +/** + * This class helps to dynamically decide how to de-/serialize classes and + * properties defined in the AAS model library. It will automatically add a default namespace + * to property names and set a default property order for contained elements. + * + * Will also add @JsonInclude(JsonInclude.Include.NON_EMPTY) to all getter methods returning any type of + * Collection<?> defined in the AAS model + */ +public class XmlDataformatAnnotationIntrospector extends JacksonXmlAnnotationIntrospector { + private static final long serialVersionUID = 1L; + + private static final String GETTER_PREFIX = "get"; + protected String myDefaultNamespace = ""; + + public XmlDataformatAnnotationIntrospector() { + super(); + myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; + } + + @Override + public String findNamespace(MapperConfig config, Annotated ann) { + String ns = super.findNamespace(null, ann); + if (ns == null) { + return myDefaultNamespace; + } else { + return ns; + } + } + + @Override + public String[] findSerializationPropertyOrder(AnnotatedClass ac) { + String[] order = super.findSerializationPropertyOrder(ac); + if (order == null) { + order = new String[] { + "extensions", "idShort", "displayName", "category", "description", "administration", "identification", "kind", "semanticId", + "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", + "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", + "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" + }; + } + return order; + } + + @Override + public JsonInclude.Value findPropertyInclusion(Annotated a) { + JsonInclude.Value result = super.findPropertyInclusion(a); + if (result != JsonInclude.Value.empty()) { + return result; + } + if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { + AnnotatedMethod method = (AnnotatedMethod) a; + if (method.getParameterCount() == 0 + && method.getName().startsWith(GETTER_PREFIX) + && Collection.class.isAssignableFrom(method.getRawReturnType()) + && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { + return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); + } + } + return result; + } +} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java index 686afa6da..1e2728ed4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +17,19 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "dataSpecifications", "embeddedDataSpecifications", "derivedFrom", "assetInformation", "submodels"}) public interface AssetAdministrationShellMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") //TODO move into IdentifiableMixin - public String getId(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "id") + public String getID(); @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodels") diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java index d4b2af09f..1ab503390 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,40 +18,27 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - @JsonPropertyOrder({ "assetKind", "globalAssetId", "specificAssetIds", "defaultThumbnail"}) public interface AssetInformationMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public List getSpecificAssetIds(); + public List getSpecificAssetIds(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetIds") - public void setSpecificAssetIds(List specificAssetIds); + public void setSpecificAssetIds(List specificAssetIds); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public Reference getGlobalAssetId(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") - public void setGlobalAssetId(Reference globalAssetId); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") - public List getBillOfMaterials(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelRef") - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "billOfMaterials") - public void setBillOfMaterials(List billOfMaterials); + public String getGlobalAssetID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "defaultThumbnail") public File getDefaultThumbnail(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java index 22b084d81..1081f1130 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,26 +17,24 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasExtension", "category", "idShort", "displayName", "description", "checksum", "administration", "id", "embeddedDataSpecification", "isCaseOf"}) public interface ConceptDescriptionMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") - // @JsonDeserialize(using = ReferencesDeserializer.class) public List getIsCaseOf(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "reference") @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "isCaseOf") - // @JsonDeserialize(using = ReferencesDeserializer.class) public void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 7698c1926..eefb98b28 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,45 +15,60 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsDefinitionTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsPreferredNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsShortNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; @JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + @JsonSerialize(using = LangStringsDefinitionTypeIec61360Serializer.class) + public List getDefinition(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - public List getDefinition(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") - public void setDefinition(List definition); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") + @JsonDeserialize(using = LangStringsDefinitionTypeIec61360Deserializer.class) + public void setDefinition(List definition); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") public LevelType getLevelType(); - // TODO -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "levelType") - // public void setLevelTypes(List levelTypes); -// @JsonInclude(JsonInclude.Include.ALWAYS) - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - public List getPreferredName(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + @JsonSerialize(using = LangStringsPreferredNameTypeIec61360Serializer.class) + public List getPreferredName(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") - public void setPreferredName(List preferredName); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "preferredName") + @JsonDeserialize(using = LangStringsPreferredNameTypeIec61360Deserializer.class) + public void setPreferredName(List preferredName); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - public List getShortName(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + @JsonSerialize(using = LangStringsShortNameTypeIec61360Serializer.class) + public List getShortName(); - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") - public void setShortName(List shortName); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "shortName") + @JsonDeserialize(using = LangStringsShortNameTypeIec61360Deserializer.class) + public void setShortName(List shortName); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "sourceOfDefinition") public String getSourceOfDefinition(); @@ -66,7 +80,7 @@ public interface DataSpecificationIEC61360Mixin { public String getUnit(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "unitId") - public Reference getUnitId(); + public Reference getUnitID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueFormat") public String getValueFormat(); @@ -77,11 +91,16 @@ public interface DataSpecificationIEC61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") public ValueList getValueList(); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueList") + public void setValueList(ValueList valueList); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIEC61360 getDataType(); + public DataTypeIec61360 getDataType(); + + } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 3b5bfe6fe..8832434c2 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -1,36 +1,46 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) -public interface EmbeddedDataSpecificationMixin { - - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") - public Reference getDataSpecification(); - - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") - @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationIEC61360 getDataSpecificationContent(); - -} +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.EmbeddedDataSpecificationsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JsonPropertyOrder({"dataSpecification", "dataSpecificationContent"}) +public interface EmbeddedDataSpecificationMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public Reference getDataSpecification(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecification") + public void setDataSpecification(Reference dataSpecification); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) + public DataSpecificationContent getDataSpecificationContent(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") + @JsonDeserialize(using = EmbeddedDataSpecificationsDeserializer.class) + public void setDataSpecificationContent(DataSpecificationContent dataSpecificationIEC61360); + +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java index fbe80a98b..461fb73c5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,25 +17,23 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - public interface EntityMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "specificAssetId") - public SpecificAssetId getExternalAssetId(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") -// @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "statements") - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = SubmodelElementsSerializer.class) @JsonDeserialize(using = SubmodelElementsDeserializer.class) public List getStatements(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "globalAssetId") + void setGlobalAssetID(String globalAssetID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java index 2d474410e..9ccd1bfc1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +17,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java index ee1c5d64a..7e801c9e1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +15,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import java.util.List; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface HasDataSpecificationMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java index 7f89ab25d..f4489b4f7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +20,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; public interface HasExtensionsMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java index 70eee5159..34e5864a5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; @JsonPropertyOrder({"type", "value"}) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java index 2c9242316..da43b241a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,16 +17,21 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface MultiLanguagePropertyMixin { - @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") -// @JsonSerialize(using = LangStringsSerializer.class) - @JsonDeserialize(using = LangStringsDeserializer.class) - public List getValue(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "langStringTextType") + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + public List getValue(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") + void setValueID(Reference valueID); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java index 5b93072b3..cb5002f92 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,36 +17,21 @@ import java.util.List; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.OperationVariableDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + public interface OperationMixin { - //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inputVariables") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") public List getInputVariables(); - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInputVariables(List inputVariables); - - // @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") - // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "inoutputVariables") - public List getInoutputVariables(); - @JsonDeserialize(using = OperationVariableDeserializer.class) public void setInoutputVariables(List inoutputVariables); - - //@JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") - // TODO: conflicting with getter above @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "operationVariable") - //@JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "outputVariables") - public List getOutputVariables(); - @JsonDeserialize(using = OperationVariableDeserializer.class) public void setOutputVariables(List outputVariables); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java index 191ab7379..91af44668 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +19,9 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java index 3d5ef989c..0028e520d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +17,17 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; + import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - public interface QualifiableMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifiers") @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "qualifier") - // TODO @JsonSerialize(using = ConstraintsSerializer.class) @JsonDeserialize(using = QualifierDeserializer.class) public List getQualifiers(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java index f3ad9cb5d..6d9a72164 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + @JsonPropertyOrder({ "semanticId", "supplementalSemanticIds", // --> HasSemantics "kind", "type", "valueType", "value", "valueId" @@ -36,7 +37,7 @@ public interface QualifierMixin { void setType(String type); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueType") - void setType(DataTypeDefXsd valueType); + void setType(DataTypeDefXsd valueType); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") void setValue(String value); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 88ef3306c..552eb1d3e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,42 +17,37 @@ import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - @JsonPropertyOrder({"hasExtensions", "category", "idShort", "displayName", "description", "checksum"}) public interface ReferableMixin { - -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") -// public String getCategory(); -// -// @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") -// public void setCategory(String category); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsSerializer.class) - public List getDescription(); + @JsonSerialize(using = LangStringsTextTypeSerializer.class) + public List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsDeserializer.class) - public void setDescription(List descriptions); + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + public void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") -// @JsonSerialize(using = LangStringsSerializer.class) - @JsonDeserialize(using = LangStringsDeserializer.class) - public List getDisplayName(); + @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) + public List getDisplayName(); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - public void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonSerialize(using = LangStringsNameTypeSerializer.class) + public void setDisplayName(List displayNames); -// @JsonInclude(JsonInclude.Include.ALWAYS) public String getIdShort(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java index 9347321b0..41d8dce6c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +22,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.KeysDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java index 4f5025748..ef49d195c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; @JsonPropertyOrder({"path", "contentType"}) public interface ResourceMixin { @@ -28,5 +29,5 @@ public interface ResourceMixin { public String getPath(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "contentType") - public DataTypeDefXsd getContentType(); + public DataTypeDefXsd getContentType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 3d9ee0220..511735600 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIdMixin { - +public interface SpecificAssetIDMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -32,5 +31,5 @@ public interface SpecificAssetIdMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectId(); + public Reference getExternalSubjectID(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java index a7d285c1f..102e1f4d8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +21,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java index 4610a971f..4992fb50f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,12 +17,14 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; + @JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayNames", "description", "checksum", // --> Referable + "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", // --> HasSemantics + "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics "qualifier", // --> Qualifiable "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications + "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List "valueType", "value", "valueId" // --> Property , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity , "first", "second", "annotations" // --> (Annotated)RelationsShipElement diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java index c62d7a497..bcb0845e9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,14 +22,12 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", - "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", - "embeddedDataSpecifications", "submodelElements"}) +@JsonPropertyOrder({ "hasExtension", "category", "idShort", "displayNames", "description", "checksum", "administration", "id", "kind", "semanticId", "supplementalSemanticIds", "qualifier", "dataSpecifications", "embeddedDataSpecifications", "submodelElements"}) public interface SubmodelMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "submodelElements") @JsonSerialize(using = SubmodelElementsSerializer.class) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java index 7a0550db6..d13a78bbb 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ValueReferencePairsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; -import java.util.List; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; public interface ValueListMixin { @@ -30,4 +31,9 @@ public interface ValueListMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") List getValueReferencePairs(); + @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePairs") + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueReferencePair") + @JsonDeserialize(using = ValueReferencePairsDeserializer.class) + public void setValueReferencePairs(List valueReferencePair); + } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java index a8a3544d7..52fc57b22 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,16 +15,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonPropertyOrder({"value", "valueId"}) +@JsonPropertyOrder({ "value", "valueID" }) public interface ValueReferencePairMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - public Reference getValueId(); + public Reference getValueID(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "value") public String getValue(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java index cd4e5d2e1..8f2e2c085 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java @@ -24,7 +24,7 @@ import javax.xml.namespace.QName; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java index 1cdf8e20e..6ba166590 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,7 +20,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java index e1b1ac179..08a2ca10e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,22 +24,22 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - public class AssetAdministrationShellEnvironmentSerializer extends JsonSerializer { private static final String[] SCHEMA_LOCATION = {"xsi:schemaLocation", - "https://admin-shell.io/aas/3/0/RC02 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd"}; + "https://admin-shell.io/aas/3/0 AAS.xsd" }; private static final QName AASENV_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "environment"); private static final QName AASLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assetAdministrationShells"); @@ -49,8 +48,6 @@ public class AssetAdministrationShellEnvironmentSerializer extends JsonSerialize private static final QName CONCEPTDICTIONARY_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "conceptDescription"); private static final QName SUBMODELLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodels"); private static final QName SUBMODEL_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "submodel"); - private static final QName ASSETLIST_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "assets"); - private static final QName ASSET_TAGNAME = new QName(AasXmlNamespaceContext.AAS_URI, "asset"); private Map namespacePrefixes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java index 0f387ca6e..800e7e233 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +23,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public class DataElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index aa99ff032..1208a07d6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +import java.io.IOException; + + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; /** @@ -34,27 +31,22 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -// TODO: solve EmbeddedDataSpecifiction issue -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { - - private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { @Override - public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } -// generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); - // TODO: Add field name according to template type generator.writeObjectField("dataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java index 306dcccec..5ca546993 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,22 +15,19 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +import java.io.IOException; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.io.IOException; public class OperationVariableSerializer extends JsonSerializer { - - private SubmodelElementSerializer ser = new SubmodelElementSerializer(); - @Override public void serialize(OperationVariable operationVariable, JsonGenerator gen, SerializerProvider serializers) throws IOException { - ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeStartObject(); xgen.writeFieldName("operationVariable"); @@ -45,17 +41,4 @@ public void serialize(OperationVariable operationVariable, JsonGenerator gen, Se xgen.writeEndObject(); } - - private void serializeOperationVariable(ToXmlGenerator xgen, OperationVariable operationVariable) throws IOException { - - - xgen.writeStartObject(); -// xgen.writeFieldName("language"); -// xgen.writeString(langString.getLanguage()); -// -// xgen.writeFieldName("text"); -// xgen.writeString(langString.getText()); - - xgen.writeEndObject(); - } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java index df63759c8..39c94f386 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,16 +18,16 @@ import java.io.IOException; import java.lang.reflect.Field; +import javax.xml.namespace.QName; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import javax.xml.namespace.QName; - public class SubmodelElementSerializer extends JsonSerializer { @Override @@ -47,7 +46,6 @@ public void serialize(SubmodelElement value, JsonGenerator gen, SerializerProvid return ; } } catch (NoSuchFieldException | IllegalAccessException e) { - // TODO: report exception throw new IOException(e); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java index 2b77c753d..6b119a711 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +23,8 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.*; public class SubmodelElementsSerializer extends JsonSerializer> { diff --git a/dataformat-xml/src/main/resources/AAS.xsd b/dataformat-xml/src/main/resources/AAS.xsd index f61f1bf08..8f8569e73 100644 --- a/dataformat-xml/src/main/resources/AAS.xsd +++ b/dataformat-xml/src/main/resources/AAS.xsd @@ -1,591 +1,1346 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index 3b1fce30d..784f3f888 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,28 +15,50 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.FileNotFoundException; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.junit.Assert; import org.junit.Test; -import java.io.FileNotFoundException; -import java.util.List; - public class XMLDeserializerTest { + @Test + public void deserializeAASSimple() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment(), env); + } + @Test - public void deserializeAASSimple() throws Exception { + public void deserializeAASSimpleAAS() throws Exception { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); - Assert.assertEquals(AASSimple.ENVIRONMENT, env); - } + + Assert.assertEquals(AASSimple.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); + } + + @Test + public void deserializeAASSimpleSubmodel() throws Exception { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment().getSubmodels(), env.getSubmodels()); + } + + @Test + public void deserializeAASSimpleConceptDescription() throws Exception { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASSIMPLE_FILE); + + Assert.assertEquals(AASSimple.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); + } @Test public void deserializeAnnotedRelationshipElement() throws Exception { @@ -57,7 +78,7 @@ public void deserializeQualifier() throws Exception { @Test public void deserializeOperation() throws Exception { - Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATION); + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE_WITH_OPERATIONS); Assert.assertNotNull(env); OperationVariable inputVariable = ((Operation) env.getSubmodels().get(0).getSubmodelElements().get(0)).getInputVariables().get(0); @@ -73,6 +94,26 @@ public void deserializeOperation() throws Exception { @Test public void deserializeAASFull() throws FileNotFoundException, DeserializationException { Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); - Assert.assertEquals(AASFull.ENVIRONMENT, env); + Assert.assertEquals(AASFull.createEnvironment(), env); } + + @Test + public void deserializeAASFullAAS() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + Assert.assertEquals(AASFull.createEnvironment().getAssetAdministrationShells(), env.getAssetAdministrationShells()); + } + + @Test + public void deserializeAASFullSubmodel() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + + Assert.assertEquals(AASFull.createEnvironment().getSubmodels(), env.getSubmodels()); + } + + @Test + public void deserializeAASFullConceptDescription() throws FileNotFoundException, DeserializationException { + Environment env = new XmlDeserializer().read(XmlSerializerTest.AASFULL_FILE); + + Assert.assertEquals(AASFull.createEnvironment().getConceptDescriptions(), env.getConceptDescriptions()); + } } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 69cc64dd7..6ca6b6c65 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; + import static org.junit.Assert.assertTrue; import java.io.File; @@ -27,24 +28,32 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.hamcrest.MatcherAssert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; import org.xml.sax.SAXException; import org.xmlunit.diff.DefaultNodeMatcher; import org.xmlunit.diff.ElementSelectors; import org.xmlunit.matchers.CompareMatcher; +import org.xmlunit.util.Predicate; -import com.fasterxml.jackson.core.JsonProcessingException; public class XmlSerializerTest { public static final java.io.File AASFULL_FILE = new java.io.File("src/test/resources/test_demo_full_example.xml"); @@ -52,7 +61,7 @@ public class XmlSerializerTest { public static final java.io.File AASSIMPLE_FILE_WITH_TEST_NAMESPACE = new java.io.File("src/test/resources/xmlExampleWithModifiedPrefix.xml"); public static final java.io.File AASFULL_FILE_WITH_ANNOTATED_RELATIONSHIP = new java.io.File("src/test/resources/annotated_relationship_example.xml"); public static final java.io.File AASFULL_FILE_WITH_QUALIFIERS = new java.io.File("src/test/resources/qualifier_example.xml"); - public static final java.io.File AASFULL_FILE_WITH_OPERATION = new java.io.File("src/test/resources/operation_example.xml"); + public static final java.io.File AASFULL_FILE_WITH_OPERATIONS = new java.io.File("src/test/resources/operation_example.xml"); private static final Logger logger = LoggerFactory.getLogger(XmlSerializerTest.class); @@ -60,14 +69,14 @@ public class XmlSerializerTest { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { + public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.xml"); - new XmlSerializer().write(file, AASSimple.ENVIRONMENT); + new XmlSerializer().write(file, AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test - public void testSerializeMinimal() throws IOException, SerializationException, SAXException { + public void testSerializeMinimal() throws SerializationException, SAXException { File file = new File("src/test/resources/minimum.xml"); Environment environment = new DefaultEnvironment.Builder() .assetAdministrationShells(new DefaultAssetAdministrationShell.Builder() @@ -81,21 +90,21 @@ public void testSerializeMinimal() throws IOException, SerializationException, S } @Test - public void testSerializeSimpleWithTestNamespacePrefix() throws IOException, SerializationException, SAXException { + public void testSerializeSimpleWithTestNamespacePrefix() throws SerializationException, SAXException { Map nsPrefixes = new HashMap<>(AasXmlNamespaceContext.PREFERRED_PREFIX_CONTEXT); nsPrefixes.put("test", nsPrefixes.get("aas")); nsPrefixes.remove("aas"); - validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.ENVIRONMENT, new XmlSerializer(nsPrefixes)); + validateXmlSerializer(AASSIMPLE_FILE_WITH_TEST_NAMESPACE, AASSimple.createEnvironment(), new XmlSerializer(nsPrefixes)); } @Test - public void testSerializeSimple() throws IOException, SerializationException, SAXException { - validateXmlSerializer(AASSIMPLE_FILE, AASSimple.ENVIRONMENT); + public void testSerializeSimple() throws SerializationException, SAXException { + validateXmlSerializer(AASSIMPLE_FILE, AASSimple.createEnvironment()); } @Test - public void testSerializeFull() throws IOException, SerializationException, SAXException { - validateXmlSerializer(AASFULL_FILE, AASFull.ENVIRONMENT); + public void testSerializeFull() throws SerializationException, SAXException { + validateXmlSerializer(AASFULL_FILE, AASFull.createEnvironment()); } @Test @@ -127,6 +136,14 @@ public void testMinimalOperationAgainstXsdSchema() throws SerializationException assertTrue(errors.isEmpty()); } + @Test + public void testGYear() throws SerializationException, SAXException { + Submodel submodel = new DefaultSubmodel.Builder().id("yearTestSm").submodelElements(new DefaultProperty.Builder().idShort("yearTestProp").valueType(DataTypeDefXsd.GYEAR).build()).build(); + String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().submodels(submodel).build()); + Set errors = validateAgainstXsdSchema(xml); + assertTrue(errors.isEmpty()); + } + @Test public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationException, SAXException { @@ -139,7 +156,7 @@ public void testDocumentationSubmodelAgainstXsdSchema() throws SerializationExce @Test public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXException { - ConceptDescription object = AASFull.ENVIRONMENT.getConceptDescriptions().get(0); + ConceptDescription object = AASFull.createEnvironment().getConceptDescriptions().get(0); String xml = new XmlSerializer().write(new DefaultEnvironment.Builder().conceptDescriptions(object).build()); Set errors = validateAgainstXsdSchema( xml ); assertTrue(errors.isEmpty()); @@ -147,12 +164,12 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc - private Set validateAgainstXsdSchema(String xml) throws SerializationException, SAXException { + private Set validateAgainstXsdSchema(String xml) throws SAXException { return new XmlSchemaValidator().validateSchema(xml); } private void validateXmlSerializer(File expectedFile, Environment environment) - throws IOException, SerializationException, SAXException { + throws SerializationException, SAXException { validateXmlSerializer(expectedFile, environment, new XmlSerializer()); } @@ -160,12 +177,61 @@ private void validateXmlSerializer(File expectedFile, Environment environment, X throws SerializationException, SAXException { String actual = xmlSerializer.write(environment); Set errors = validateAgainstXsdSchema(actual); - logger.info(actual); + logger.debug(actual); logErrors(expectedFile.getName(), errors); assertTrue(errors.isEmpty()); - CompareMatcher xmlTestMatcher = CompareMatcher.isSimilarTo(expectedFile).normalizeWhitespace().ignoreComments() - .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes)); - MatcherAssert.assertThat(actual, xmlTestMatcher); + CompareMatcher xmlTestMatcher = CompareMatcher + .isSimilarTo(expectedFile) + .normalizeWhitespace() + .ignoreComments() + .withNodeFilter((Predicate) node -> { + return ignoreDefaults(node); + }) // ignore default fields + .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndAllAttributes) + ); + MatcherAssert.assertThat(removeDefaults(actual), xmlTestMatcher); + } + + private String removeDefaults(String aasXml) { + aasXml = aasXml.replace("Instance", ""); + aasXml = aasXml.replace("Instance", ""); + aasXml = aasXml.replace("VARIABLE", ""); + aasXml = aasXml.replace("VARIABLE", ""); + aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions + aasXml = aasXml.replace("PROPERTY", ""); // TODO: only for ConceptDescriptions + aasXml = aasXml.replace("ConceptQualifier", ""); + aasXml = aasXml.replace("ConceptQualifier", ""); + aasXml = aasXml.replace("true", ""); + aasXml = aasXml.replace("true", ""); + return aasXml; + } + + private boolean ignoreDefaults(Node node) { + if (node.getLocalName() != null + && node.getLocalName().equals("kind") + && node.getFirstChild().getNodeValue().equals("Instance")) { + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("category") + && node.getFirstChild().getNodeValue().equals("VARIABLE")) { + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("category") + && node.getFirstChild().getNodeValue().equals("PROPERTY")) { // TODO: only for ConceptDescriptions + return false; + } + + if (node.getLocalName() != null + && node.getLocalName().equals("orderRelevant") + && node.getFirstChild().getNodeValue().equals("true")) { + return false; + } + + return true; } private void logErrors(String validatedFileName, Set errors) { diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java index 8cff59e30..eff9fa49c 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,7 +46,7 @@ public static void prepareValidator() throws SAXException { } @Test - @Parameters({"src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml"}) + @Parameters({ "src/test/resources/minimum.xml", "src/test/resources/Example_AAS_ServoDCMotor - Simplified.xml", "src/test/resources/test_demo_full_example.xml" }) // import from admin-shell.io -> is actually V3 // -> fix name, as soon as it is fixed externally public void validateValidXml(String file) throws IOException { @@ -57,7 +56,7 @@ public void validateValidXml(String file) throws IOException { } @Test - @Parameters({"src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid_V2.0.xml"}) + @Parameters({ "src/test/resources/invalidXmlExample.xml", "src/test/resources/ServoDCMotor_invalid.xml" }) public void validateInvalidXml(String file) throws IOException { Set errors = validateXmlFile(file); logErrors(file, errors); diff --git a/dataformat-xml/src/test/resources/annotated_relationship_example.xml b/dataformat-xml/src/test/resources/annotated_relationship_example.xml index d2fee638f..3573866cb 100644 --- a/dataformat-xml/src/test/resources/annotated_relationship_example.xml +++ b/dataformat-xml/src/test/resources/annotated_relationship_example.xml @@ -1,11 +1,11 @@ - + TestSubmodel - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance @@ -14,7 +14,7 @@ Parameter ExampleAnnotatedRelationshipElement - GlobalReference + ExternalReference GlobalReference @@ -60,7 +60,6 @@ Parameter ExampleProperty3 - Instance xs:string some example annotation diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index 799effff7..b7b77781f 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,5 +1,5 @@ - diff --git a/dataformat-xml/src/test/resources/minimum.xml b/dataformat-xml/src/test/resources/minimum.xml index 705afc014..12445b81e 100644 --- a/dataformat-xml/src/test/resources/minimum.xml +++ b/dataformat-xml/src/test/resources/minimum.xml @@ -1,5 +1,7 @@ - + https://acplt.org/Test_AssetAdministrationShell @@ -8,5 +10,4 @@ - - + \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/operation_example.xml b/dataformat-xml/src/test/resources/operation_example.xml index 62b9d979c..bbc5798bb 100644 --- a/dataformat-xml/src/test/resources/operation_example.xml +++ b/dataformat-xml/src/test/resources/operation_example.xml @@ -1,28 +1,28 @@ - + TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance - GlobalReference + ExternalReference GlobalReference @@ -35,18 +35,17 @@ Parameter ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -61,7 +60,7 @@ Constant ExampleProperty1 - GlobalReference + ExternalReference GlobalReference @@ -72,7 +71,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -89,7 +88,7 @@ Variable ExampleProperty2 - GlobalReference + ExternalReference GlobalReference @@ -100,7 +99,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -119,7 +118,7 @@ Constant ExampleProperty2 - GlobalReference + ExternalReference GlobalReference @@ -130,7 +129,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -149,7 +148,7 @@ Constant ExampleProperty3 - GlobalReference + ExternalReference GlobalReference @@ -160,7 +159,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index c7f7131dd..93b4cc661 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,5 +1,5 @@ - + TestSubmodel @@ -13,7 +13,7 @@ ManufacturerName - GlobalReference + ExternalReference GlobalReference @@ -36,7 +36,7 @@ xs:string http://acplt.org/ValueId/ACPLT - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 3a2ce75a1..26fbaefe4 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -1,15 +1,27 @@ - + TestAssetAdministrationShell + + + en-us + An Example Asset Administration Shell for the test application + + + de + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_AssetAdministrationShell - GlobalReference + ExternalReference AssetAdministrationShell @@ -19,19 +31,11 @@ Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset - - - + https://acplt.org/Test_Asset - GlobalReference + ExternalReference Submodel @@ -40,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -49,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -64,19 +68,11 @@ https://acplt.org/Test_AssetAdministrationShell_Mandatory Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Mandatory - - - + https://acplt.org/Test_Asset_Mandatory - GlobalReference + ExternalReference Submodel @@ -85,7 +81,7 @@ - GlobalReference + ExternalReference Submodel @@ -100,39 +96,33 @@ https://acplt.org/Test_AssetAdministrationShell2_Mandatory Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Mandatory - - - + https://acplt.org/Test_Asset_Mandatory TestAssetAdministrationShell + + + en-us + An Example Asset Administration Shell for the test application + + + de + Ein Beispiel-Verwaltungsschale für eine Test-Anwendung + + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_AssetAdministrationShell_Missing Instance - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset_Missing - - - + https://acplt.org/Test_Asset_Missing - GlobalReference + ExternalReference Submodel @@ -147,23 +137,23 @@ Identification - + en-us An example asset identification submodel for the test application - - + + de Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 http://acplt.org/Submodels/Assets/TestAsset/Identification Instance - GlobalReference + ExternalReference Submodel @@ -174,18 +164,24 @@ ManufacturerName + + + en-us + Manufacturer Name + + - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -208,7 +204,7 @@ xs:string http://acplt.org/ValueId/ACPLT - GlobalReference + ExternalReference GlobalReference @@ -218,19 +214,20 @@ + VARIABLE InstanceId - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -238,10 +235,30 @@ + + + ExternalReference + + + GlobalReference + something_random_e14ad770 + + + + + ExternalReference + + + GlobalReference + something_random_bd061acd + + + + xs:string 978-8234-234-342 - GlobalReference + ExternalReference GlobalReference @@ -255,22 +272,22 @@ BillOfMaterial - + en-us An example bill of material submodel for the test application - - + + de Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung - + - 0.9 + 0 http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial Instance - GlobalReference + ExternalReference Submodel @@ -282,17 +299,17 @@ ExampleEntity - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -302,21 +319,21 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -326,8 +343,8 @@ xs:string http://acplt.org/ValueId/ExampleValue2 - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValue2 @@ -336,21 +353,21 @@ - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -360,8 +377,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -375,17 +392,17 @@ ExampleEntity2 - + en-us Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation. - - + + de Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist - + - GlobalReference + ExternalReference GlobalReference @@ -394,38 +411,30 @@ SelfManagedEntity - - GlobalReference - - - AssetAdministrationShell - https://acplt.org/Test_Asset2 - - - + https://acplt.org/Test_Asset2 TestSubmodel - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel Instance - GlobalReference + ExternalReference GlobalReference @@ -435,20 +444,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -464,8 +473,8 @@ https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -492,20 +501,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -521,8 +530,8 @@ https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -549,30 +558,28 @@ - Parameter + PARAMETER ExampleProperty3 - Instance xs:string some example annotation - Parameter + PARAMETER ExampleOperation - Template - + en-us Example Operation object - - + + de Beispiel Operation Element - + - GlobalReference + ExternalReference GlobalReference @@ -584,20 +591,20 @@ - Constant + CONSTANT ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -608,7 +615,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -624,20 +631,20 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -648,7 +655,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -664,20 +671,20 @@ - Constant + CONSTANT ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -688,7 +695,7 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -702,935 +709,60 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - GlobalReference + ExternalReference GlobalReference http://acplt.org/Capabilities/ExampleCapability -<<<<<<< HEAD - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - GlobalReference -======= - - - - - ExampleRelationshipElement - Parameter - - Example RelationshipElement object - Beispiel RelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - ExampleEntity - ExampleProperty2 - - - - - - - ExampleAnnotatedRelationshipElement - Parameter - - Example AnnotatedRelationshipElement object - Beispiel AnnotatedRelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial - ExampleEntity - ExampleProperty2 - - - - - - ExampleProperty3 - Parameter - Instance - some example annotation - string - - - - - - - - ExampleOperation - Parameter - - Example Operation object - Beispiel Operation Element - - Template - - - http://acplt.org/Operations/ExampleOperation - - - - - - ExampleProperty3 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - ExampleProperty1 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - ExampleProperty2 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - - - - ExampleCapability - Parameter - - Example Capability object - Beispiel Capability Element - - - - http://acplt.org/Capabilities/ExampleCapability - - - - - - - ExampleBasicEvent - Parameter - - Example BasicEvent object - Beispiel BasicEvent Element - - - - http://acplt.org/Events/ExampleBasicEvent - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/ValueId/ExampleValueId - - - http://acplt.org/ValueId/ExampleValueId - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - - http://acplt.org/ValueId/ExampleMultiLanguageValueId - - - - Example value of a MultiLanguageProperty element - Beispielswert für ein MulitLanguageProperty-Element - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - - - http://acplt.org/Ranges/ExampleRange - - - 100 - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - false - false - - - - ExampleBlob - Parameter - - Example Blob object - Beispiel Blob Element - - - - http://acplt.org/Blobs/ExampleBlob - - - AQIDBAU= - application/pdf - - - - - ExampleFile - Parameter - - Example File object - Beispiel File Element - - - - http://acplt.org/Files/ExampleFile - - - /TestFile.pdf - application/pdf - - - - - ExampleReferenceElement - Parameter - - Example Reference Element object - Beispiel Reference Element Element - - - - http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - https://acplt.org/Test_Submodel - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - - - - - Test_Submodel_Mandatory - https://acplt.org/Test_Submodel_Mandatory - Template - - - - ExampleRelationshipElement - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - ExampleAnnotatedRelationshipElement - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - - ExampleOperation - Template - - - - - ExampleCapability - - - - - ExampleBasicEvent - - - https://acplt.org/Test_Submodel_Mandatory - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - true - - - - ExampleProperty - string - - - - - ExampleMultiLanguageProperty - - - - - ExampleRange - int - - - - - - - - ExampleSubmodelCollectionUnordered - false - false - - - - ExampleBlob - application/pdf - - - - - ExampleFile - application/pdf - - - - - ExampleReferenceElement - - - - - - - - ExampleSubmodelCollectionUnordered2 - false - false - - - - - - - Test_Submodel2_Mandatory - https://acplt.org/Test_Submodel2_Mandatory - Instance - - - - TestSubmodel - - An example submodel for the test application - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - 0 - 0.9 - - https://acplt.org/Test_Submodel_Missing - Instance - ->>>>>>> update-to-rc02-smlist-tests + ExternalReference GlobalReference http://acplt.org/Events/ExampleBasicEvent -<<<<<<< HEAD - GlobalReference -======= - - - - - ExampleRelationshipElement - Parameter - - Example RelationshipElement object - Beispiel RelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleRelationshipElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - - ExampleAnnotatedRelationshipElement - Parameter - - Example AnnotatedRelationshipElement object - Beispiel AnnotatedRelationshipElement Element - - - - http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleMultiLanguageProperty - - - - - - ExampleProperty - Parameter - Instance - some example annotation - string - - - - - - - - ExampleOperation - Parameter - - Example Operation object - Beispiel Operation Element - - Template - - - http://acplt.org/Operations/ExampleOperation - - - - - - ExampleProperty3 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - ExampleProperty1 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - ExampleProperty2 - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - - - - ExampleCapability - Parameter - - Example Capability object - Beispiel Capability Element - - - - http://acplt.org/Capabilities/ExampleCapability - - - - - - - ExampleBasicEvent - Parameter - - Example BasicEvent object - Beispiel BasicEvent Element - - - - http://acplt.org/Events/ExampleBasicEvent - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered - - - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - - - http://acplt.org/Properties/ExampleProperty - - - - - http://acplt.org/Qualifier/ExampleQualifier - string - - - exampleValue - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - Example value of a MultiLanguageProperty element - Beispielswert für ein MulitLanguageProperty-Element - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - - - http://acplt.org/Ranges/ExampleRange - - - 100 - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - - - - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered - - - false - false - - - - ExampleBlob - Parameter - - Example Blob object - Beispiel Blob Element - - - - http://acplt.org/Blobs/ExampleBlob - - - AQIDBAU= - application/pdf - - - - - ExampleFile - Parameter - - Example File object - Beispiel File Element - - - - http://acplt.org/Files/ExampleFile - - - /TestFile.pdf - application/pdf - - - - - ExampleReferenceElement - Parameter - - Example Reference Element object - Beispiel Reference Element Element - - - - http://acplt.org/ReferenceElements/ExampleReferenceElement - - - - - https://acplt.org/Test_Submodel_Missing - ExampleSubmodelCollectionOrdered - ExampleProperty - - - - - - - - - - - TestSubmodel - - An example submodel for the test application - Ein Beispiel-Teilmodell für eine Test-Anwendung - - - 0 - 0.9 - - https://acplt.org/Test_Submodel_Template - Template - ->>>>>>> update-to-rc02-smlist-tests + ModelReference Submodel https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -1638,48 +770,50 @@ - Input - On + input + on - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example ExampleSubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel ExampleSubmodelElementListOrdered Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -1689,8 +823,8 @@ xs:string http://acplt.org/ValueId/ExampleValueId - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleValueId @@ -1699,21 +833,21 @@ - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -1721,18 +855,18 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ValueId/ExampleMultiLanguageValueId @@ -1741,21 +875,21 @@ - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -1767,46 +901,46 @@ 100 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -1817,21 +951,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -1842,21 +976,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -1864,15 +998,15 @@ - GlobalReference - + ExternalReference + Submodel https://acplt.org/Test_Submodel - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -1900,8 +1034,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered Property @@ -1917,8 +1051,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered MultiLanguageProperty @@ -1938,11 +1072,11 @@ SubmodelElementCollection - ExampleSubmodelCollectionOrdered + ExampleSubmodelElementCollection - Property - ExampleProperty + Blob + ExampleBlob @@ -1954,8 +1088,8 @@ https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered MultiLanguageProperty @@ -1966,7 +1100,6 @@ ExampleOperation - Template ExampleCapability @@ -1974,15 +1107,15 @@ ExampleBasicEvent - GlobalReference + ModelReference Submodel https://acplt.org/Test_Submodel_Mandatory - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListUnordered Property @@ -1990,11 +1123,13 @@ - Output - Off + output + off - - ExampleSubmodelCollectionOrdered + + ExampleSubmodelElementListUnordered + false + SubmodelElement ExampleProperty @@ -2008,9 +1143,9 @@ xs:int - + - ExampleSubmodelCollectionUnordered + ExampleSubmodelElementCollection ExampleBlob @@ -2026,7 +1161,7 @@ - ExampleSubmodelCollectionUnordered2 + ExampleSubmodelElementCollection2 @@ -2036,25 +1171,25 @@ Instance - TestSubmodel + TestSubmodelMissing - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel_Missing Instance - GlobalReference + ExternalReference GlobalReference @@ -2064,20 +1199,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -2093,8 +1228,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2110,8 +1245,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered MultiLanguageProperty @@ -2121,20 +1256,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - GlobalReference + ExternalReference GlobalReference @@ -2150,8 +1285,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2167,8 +1302,8 @@ https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered MultiLanguageProperty @@ -2178,30 +1313,28 @@ - Parameter + PARAMETER ExampleProperty - Instance xs:string some example annotation - Parameter + PARAMETER ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2213,20 +1346,20 @@ - Constant + CONSTANT ExampleProperty1 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2250,20 +1383,20 @@ - Constant + CONSTANT ExampleProperty2 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2287,20 +1420,20 @@ - Constant + CONSTANT ExampleProperty3 - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference + ExternalReference GlobalReference @@ -2308,7 +1441,6 @@ -<<<<<<< HEAD http://acplt.org/Qualifier/ExampleQualifier @@ -2323,20 +1455,20 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - GlobalReference + ExternalReference GlobalReference @@ -2346,20 +1478,20 @@ - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - GlobalReference + ExternalReference GlobalReference @@ -2368,15 +1500,15 @@ - GlobalReference + ExternalReference Submodel https://acplt.org/Test_Submodel_Missing - SubmodelElementCollection - ExampleSubmodelCollectionOrdered + SubmodelElementList + ExampleSubmodelElementListOrdered Property @@ -2384,48 +1516,50 @@ - Input - On + input + on - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example SubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel SubmodelElementListOrdered Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -2442,21 +1576,21 @@ exampleValue - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -2464,32 +1598,32 @@ - + en-us Example value of a MultiLanguageProperty element - - + + de Beispielswert für ein MultiLanguageProperty-Element - + - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -2501,46 +1635,46 @@ 100 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -2551,21 +1685,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -2576,21 +1710,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -2598,7 +1732,7 @@ - GlobalReference + ModelReference Submodel @@ -2606,11 +1740,11 @@ SubmodelElementCollection - ExampleSubmodelCollectionOrdered + ExampleSubmodelElementCollection - Property - ExampleProperty + File + ExampleFile @@ -2620,25 +1754,25 @@ - TestSubmodel + TestSubmodelTemplate - + en-us An example submodel for the test application - - + + de Ein Beispiel-Teilmodell für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_Submodel_Template Template - GlobalReference + ExternalReference GlobalReference @@ -2648,21 +1782,20 @@ - Parameter + PARAMETER ExampleRelationshipElement - + en-us Example RelationshipElement object - - + + de Beispiel RelationshipElement Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2673,6 +1806,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2682,6 +1823,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2690,21 +1839,20 @@ - Parameter + PARAMETER ExampleAnnotatedRelationshipElement - + en-us Example AnnotatedRelationshipElement object - - + + de Beispiel AnnotatedRelationshipElement Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2715,6 +1863,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2724,6 +1880,14 @@ ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty @@ -2732,21 +1896,20 @@ - Parameter + PARAMETER ExampleOperation - + en-us Example Operation object - - + + de Beispiel Operation Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2758,41 +1921,20 @@ - Constant + CONSTANT ExampleProperty -<<<<<<< HEAD -======= - - - ExampleProperty - - - - - - - ExampleSubmodelCollectionOrdered - Parameter - Example SubmodelElementCollectionOrdered object - Beispiel SubmodelElementCollectionOrdered Element - ->>>>>>> update-to-rc02-smlist-tests -======= - - + en-us Example Property object - - + + de Beispiel Property Element - + ->>>>>>> update-to-rc02-xml - Template - GlobalReference + ExternalReference GlobalReference @@ -2800,7 +1942,6 @@ -<<<<<<< HEAD xs:string @@ -2810,108 +1951,20 @@ - Constant + CONSTANT ExampleProperty -<<<<<<< HEAD -======= - true - - - - ExampleProperty - Constant - - Example Property object - Beispiel Property Element - - Template - - - http://acplt.org/Properties/ExampleProperty - - - string - - - - - ExampleMultiLanguageProperty - Constant - - Example MultiLanguageProperty object - Beispiel MulitLanguageProperty Element - - Template - - - http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty - - - - - - - ExampleRange - Parameter - - Example Range object - Beispiel Range Element - - Template - - - http://acplt.org/Ranges/ExampleRange - - - 100 - int - - - - - ExampleRange2 - Parameter - - Example Range object - Beispiel Range Element - - Template - - - http://acplt.org/Ranges/ExampleRange - - - 0 - int - - - - - - - - ExampleSubmodelCollectionUnordered - Parameter - Example SubmodelElementCollectionUnordered object - Beispiel SubmodelElementCollectionUnordered Element - ->>>>>>> update-to-rc02-smlist-tests -======= - - + en-us Example Property object - - + + de Beispiel Property Element - + ->>>>>>> update-to-rc02-xml - Template - GlobalReference + ExternalReference GlobalReference @@ -2928,21 +1981,20 @@ - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2957,21 +2009,20 @@ - Parameter + PARAMETER ExampleCapability - + en-us Example Capability object - - + + de Beispiel Capability Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -2981,21 +2032,20 @@ - Parameter + PARAMETER ExampleBasicEvent - + en-us Example BasicEvent object - - + + de Beispiel BasicEvent Element - + - Template - GlobalReference + ExternalReference GlobalReference @@ -3004,58 +2054,66 @@ - GlobalReference + ModelReference + + Submodel + https://acplt.org/Test_Submodel_Template + + + Operation + ExampleOperation + Property ExampleProperty - Output - Off + output + off - - Parameter - ExampleSubmodelCollectionOrdered + + PARAMETER + ExampleSubmodelElementListOrdered - + en-us - Example SubmodelElementCollectionOrdered object - - + Example SubmodelElementListOrdered object + + de - Beispiel SubmodelElementCollectionOrdered Element - + Beispiel SubmodelElementListOrdered Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered + http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered + true + SubmodelElement - Constant + CONSTANT ExampleProperty - + en-us Example Property object - - + + de Beispiel Property Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Properties/ExampleProperty @@ -3065,22 +2123,21 @@ xs:string - Constant + CONSTANT ExampleMultiLanguageProperty - + en-us Example MultiLanguageProperty object - - + + de Beispiel MultiLanguageProperty Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty @@ -3089,22 +2146,21 @@ - Parameter + PARAMETER ExampleRange - + en-us Example Range object - - + + de Beispiel Range Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -3115,22 +2171,21 @@ 100 - Parameter + PARAMETER ExampleRange2 - + en-us Example Range object - - + + de Beispiel Range Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Ranges/ExampleRange @@ -3141,48 +2196,46 @@ 0 - + - Parameter - ExampleSubmodelCollectionUnordered + PARAMETER + ExampleSubmodelElementCollection - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection - Parameter + PARAMETER ExampleBlob - + en-us Example Blob object - - + + de Beispiel Blob Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Blobs/ExampleBlob @@ -3192,22 +2245,21 @@ application/pdf - Parameter + PARAMETER ExampleFile - + en-us Example File object - - + + de Beispiel File Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Files/ExampleFile @@ -3217,22 +2269,21 @@ application/pdf - Parameter + PARAMETER ExampleReferenceElement - + en-us Example Reference Element object - - + + de Beispiel Reference Element Element - + - Template - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/ReferenceElements/ExampleReferenceElement @@ -3243,25 +2294,24 @@ - Parameter - ExampleSubmodelCollectionUnordered2 + PARAMETER + ExampleSubmodelElementCollection2 - + en-us - Example SubmodelElementCollectionUnordered object - - + Example SubmodelElementCollection object + + de - Beispiel SubmodelElementCollectionUnordered Element - + Beispiel SubmodelElementCollection Element + - Template - GlobalReference + ExternalReference GlobalReference - http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered + http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection @@ -3273,27 +2323,27 @@ TestConceptDescription - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_ConceptDescription - GlobalReference + ExternalReference GlobalReference - http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription + http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription @@ -3304,67 +2354,68 @@ https://acplt.org/Test_ConceptDescription_Mandatory + PROPERTY TestConceptDescription1 - + en-us An example concept description for the test application - - + + de Ein Beispiel-ConceptDescription für eine Test-Anwendung - + - 0.9 - 0 + 0 + 9 https://acplt.org/Test_ConceptDescription_Missing TestSpec_01 - 0.9 - 0 + 0 + 9 http://acplt.org/DataSpecifciations/Example/Identification - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de Test Specification - - + + en-us TestSpecification - + - + de Test Spec - - + + en-us TestSpec - + SpaceUnit - GlobalReference - + ExternalReference + GlobalReference http://acplt.org/Units/SpaceUnit @@ -3375,14 +2426,14 @@ SU REAL_MEASURE - + de Dies ist eine Data Specification für Testzwecke - - + + en-us This is a DataSpecification for testing purposes - + string @@ -3390,7 +2441,7 @@ http://acplt.org/ValueId/ExampleValueId - GlobalReference + ExternalReference GlobalReference @@ -3402,7 +2453,7 @@ http://acplt.org/ValueId/ExampleValueId2 - GlobalReference + ExternalReference GlobalReference @@ -3414,14 +2465,13 @@ TEST - Max - GlobalReference + ExternalReference GlobalReference diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index a09966209..5e37d5016 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -1,26 +1,20 @@ - + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - - GlobalReference - - - AssetAdministrationShell - http://customer.com/assets/KHBVZJSQKIY - - - + http://customer.com/assets/KHBVZJSQKIY EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - GlobalReference + ExternalReference GlobalReference @@ -33,7 +27,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - GlobalReference + ExternalReference GlobalReference @@ -50,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -59,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -68,7 +62,7 @@ - GlobalReference + ExternalReference Submodel @@ -83,9 +77,8 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 - Instance - GlobalReference + ExternalReference GlobalReference @@ -95,11 +88,10 @@ - Parameter + PARAMETER MaxRotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -119,9 +111,8 @@ OperatingManual - Instance - GlobalReference + ExternalReference ConceptDescription @@ -132,9 +123,8 @@ Title - Instance - GlobalReference + ExternalReference ConceptDescription @@ -147,9 +137,8 @@ DigitalFile_PDF - Instance - GlobalReference + ExternalReference ConceptDescription @@ -170,11 +159,10 @@ Instance - Variable + VARIABLE RotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -195,44 +183,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -245,44 +233,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -294,35 +282,35 @@ MaxRotationSpeed 2 - 2.1 + 1 0173-1#02-BAA120#008 - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - GlobalReference + ExternalReference GlobalReference @@ -333,14 +321,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -354,39 +342,39 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActualRotationSpeed - + ActRotationSpeed + 1/min - GlobalReference + ExternalReference GlobalReference @@ -397,14 +385,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -417,40 +405,40 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2cb861291..2db066ec3 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -1,25 +1,20 @@ - + + ExampleMotor http://customer.com/aas/9175_7013_7091_9168 Instance - - GlobalReference - - - AssetAdministrationShell - http://customer.com/assets/KHBVZJSQKIY - - - + http://customer.com/assets/KHBVZJSQKIY EquipmentID 538fd1b3-f99f-4a52-9c75-72e9fa921270 - GlobalReference + ExternalReference GlobalReference @@ -32,7 +27,7 @@ DeviceID QjYgPggjwkiHk4RrQiYSLg== - GlobalReference + ExternalReference GlobalReference @@ -49,7 +44,7 @@ - GlobalReference + ExternalReference Submodel @@ -58,7 +53,7 @@ - GlobalReference + ExternalReference Submodel @@ -67,7 +62,7 @@ - GlobalReference + ExternalReference Submodel @@ -82,9 +77,8 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 - Instance - GlobalReference + ExternalReference GlobalReference @@ -94,11 +88,10 @@ - Parameter + PARAMETER MaxRotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -118,9 +111,8 @@ OperatingManual - Instance - GlobalReference + ExternalReference ConceptDescription @@ -131,9 +123,8 @@ Title - Instance - GlobalReference + ExternalReference ConceptDescription @@ -146,9 +137,8 @@ DigitalFile_PDF - Instance - GlobalReference + ExternalReference ConceptDescription @@ -169,11 +159,10 @@ Instance - Variable + VARIABLE RotationSpeed - Instance - GlobalReference + ExternalReference ConceptDescription @@ -194,44 +183,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Title - - + + DE Titel - + - + EN Title - - + + DE Titel - + ExampleString ExampleString STRING_TRANSLATABLE - + EN SprachabhängigerTiteldesDokuments. - + @@ -244,44 +233,44 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN DigitalFile - - + + EN DigitalFile - + - + EN DigitalFile - - + + DE DigitaleDatei - + ExampleString ExampleString STRING - + EN A file representing the document version. In addition to the mandatory PDF file, other files can be specified. - + @@ -293,35 +282,35 @@ MaxRotationSpeed 2 - 2.1 + 1 0173-1#02-BAA120#008 - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + de max.Drehzahl - - + + en Max.rotationspeed - + 1/min - GlobalReference + ExternalReference GlobalReference @@ -332,14 +321,14 @@ ExampleString REAL_MEASURE - + de HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf - - + + EN Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated - + @@ -353,39 +342,39 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + DE AktuelleDrehzahl - - + + EN Actualrotationspeed - + - + DE AktuelleDrehzahl - - + + EN - ActualRotationSpeed - + ActRotationSpeed + 1/min - GlobalReference + ExternalReference GlobalReference @@ -396,14 +385,14 @@ ExampleString REAL_MEASURE - + DE Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird - - + + EN Actual rotationspeed with which the motor or feedingunit is operated - + @@ -416,40 +405,40 @@ - GlobalReference + ExternalReference GlobalReference - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 - + EN Document - + - + EN Document - - + + DE Dokument - + ExampleString [ISO15519-1:2010] STRING - + EN Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - + From f44bd1ace0fb60b6c900ebb63f21fe5da0bfe431 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 14:46:40 +0200 Subject: [PATCH 12/91] Remove dataformat-rdf project --- dataformat-rdf/pom.xml | 45 - .../v3/dataformat/rdf/FallbackSerializer.java | 43 - .../v3/dataformat/rdf/IgnoreTypeMixIn.java | 23 - .../aas4j/v3/dataformat/rdf/JsonLDModule.java | 53 - .../v3/dataformat/rdf/JsonLDSerializer.java | 197 --- .../rdf/JsonLDSerializerModifier.java | 45 - .../dataformat/rdf/JsonLdEnumSerializer.java | 89 -- .../dataformat/rdf/LangStringSerializer.java | 54 - .../aas4j/v3/dataformat/rdf/Parser.java | 1171 ----------------- .../aas4j/v3/dataformat/rdf/Serializer.java | 309 ----- .../v3/dataformat/rdf/UriSerializer.java | 54 - .../rdf/custom/BigDecimalSerializer.java | 43 - .../rdf/custom/JsonLdEnumMixin.java | 24 - .../rdf/custom/LangStringMixin.java | 36 - .../rdf/custom/ReflectiveMixInResolver.java | 42 - .../XMLGregorianCalendarDeserializer.java | 50 - .../XMLGregorianCalendarSerializer.java | 48 - .../AdministrativeInformationMixin.java | 39 - .../AnnotatedRelationshipElementMixin.java | 34 - .../mixins/AssetAdministrationShellMixin.java | 48 - .../rdf/mixins/AssetInformationMixin.java | 61 - .../rdf/mixins/BasicEventElementMixin.java | 80 -- .../v3/dataformat/rdf/mixins/BlobMixin.java | 39 - .../rdf/mixins/CapabilityMixin.java | 28 - .../rdf/mixins/ConceptDescriptionMixin.java | 34 - .../rdf/mixins/DataElementMixin.java | 38 - .../mixins/DataSpecificationContentMixin.java | 34 - .../DataSpecificationIEC61360Mixin.java | 107 -- .../DataSpecificationPhysicalUnitMixin.java | 100 -- .../EmbeddedDataSpecificationMixin.java | 45 - .../v3/dataformat/rdf/mixins/EntityMixin.java | 55 - .../rdf/mixins/EnvironmentMixin.java | 48 - .../rdf/mixins/EventElementMixin.java | 34 - .../rdf/mixins/EventMessageMixin.java | 28 - .../dataformat/rdf/mixins/ExtensionMixin.java | 51 - .../v3/dataformat/rdf/mixins/FileMixin.java | 39 - .../dataformat/rdf/mixins/FormulaMixin.java | 34 - .../rdf/mixins/HasDataSpecificationMixin.java | 50 - .../rdf/mixins/HasExtensionsMixin.java | 34 - .../dataformat/rdf/mixins/HasKindMixin.java | 40 - .../rdf/mixins/HasSemanticsMixin.java | 50 - .../rdf/mixins/IdentifiableMixin.java | 48 - .../mixins/IdentifierKeyValuePairMixin.java | 45 - .../rdf/mixins/IdentifierMixin.java | 32 - .../v3/dataformat/rdf/mixins/KeyMixin.java | 40 - .../mixins/MultiLanguagePropertyMixin.java | 41 - .../rdf/mixins/ObjectAttributesMixin.java | 34 - .../dataformat/rdf/mixins/OperationMixin.java | 45 - .../rdf/mixins/OperationVariableMixin.java | 33 - .../rdf/mixins/PolicyDecisionPointMixin.java | 33 - .../mixins/PolicyEnforcementPointsMixin.java | 33 - .../mixins/PolicyInformationPointsMixin.java | 40 - .../dataformat/rdf/mixins/PropertyMixin.java | 45 - .../rdf/mixins/QualifiableMixin.java | 41 - .../dataformat/rdf/mixins/QualifierMixin.java | 51 - .../v3/dataformat/rdf/mixins/RangeMixin.java | 45 - .../dataformat/rdf/mixins/ReferableMixin.java | 59 - .../rdf/mixins/ReferenceElementMixin.java | 33 - .../dataformat/rdf/mixins/ReferenceMixin.java | 42 - .../rdf/mixins/RelationshipElementMixin.java | 44 - .../dataformat/rdf/mixins/ResourceMixin.java | 41 - .../rdf/mixins/SpecificAssetIdMixin.java | 48 - .../rdf/mixins/SubjectAttributesMixin.java | 34 - .../SubmodelElementCollectionMixin.java | 46 - .../rdf/mixins/SubmodelElementListMixin.java | 62 - .../rdf/mixins/SubmodelElementMixin.java | 41 - .../dataformat/rdf/mixins/SubmodelMixin.java | 34 - .../dataformat/rdf/mixins/ValueListMixin.java | 37 - .../rdf/mixins/ValueReferencePairMixin.java | 39 - .../v3/dataformat/rdf/mixins/ViewMixin.java | 34 - .../rdf/preprocessing/BasePreprocessor.java | 54 - .../rdf/preprocessing/JsonPreprocessor.java | 43 - .../preprocessing/TypeNamePreprocessor.java | 195 --- .../aas4j/v3/dataformat/rdf/ParserTest.java | 154 --- .../v3/dataformat/rdf/SerializerTest.java | 101 -- .../v3/dataformat/rdf/SerializerUtil.java | 46 - dataformat-rdf/src/test/resources/AASFull.ttl | 354 ----- .../resources/AAS_Reference_shortExample.nt | 16 - .../resources/AAS_Reference_shortExample.ttl | 27 - .../AssetAdministrationShell_Example.ttl | 56 - .../src/test/resources/Complete_Example.ttl | 347 ----- .../src/test/resources/Overall-Example.nt | 253 ---- .../src/test/resources/ReferenceExample.ttl | 18 - .../Submodel_SubmodelElement_Example.ttl | 137 -- .../Submodel_SubmodelElement_shortExample.nt | 25 - .../Submodel_SubmodelElement_shortExample.ttl | 42 - .../resources/example-from-serializer.jsonld | 88 -- 87 files changed, 6632 deletions(-) delete mode 100644 dataformat-rdf/pom.xml delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java delete mode 100644 dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java delete mode 100644 dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java delete mode 100644 dataformat-rdf/src/test/resources/AASFull.ttl delete mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt delete mode 100644 dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Complete_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Overall-Example.nt delete mode 100644 dataformat-rdf/src/test/resources/ReferenceExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt delete mode 100644 dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl delete mode 100644 dataformat-rdf/src/test/resources/example-from-serializer.jsonld diff --git a/dataformat-rdf/pom.xml b/dataformat-rdf/pom.xml deleted file mode 100644 index 8d65df6de..000000000 --- a/dataformat-rdf/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - org.eclipse.digitaltwin.aas4j - dataformat-parent - ${revision} - - dataformat-rdf - Asset Administration Shell RDF-Serializer - - - - ${groupId} - dataformat-core - ${revision} - - - ${groupId} - dataformat-core - ${revision} - tests - test - - - org.apache.jena - jena-arq - ${jena.version} - - - org.slf4j - slf4j-simple - ${slf4j.version} - test - - - pl.pragmatists - JUnitParams - ${junit-params.version} - test - - - diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java deleted file mode 100644 index b787d56a2..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/FallbackSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import java.io.IOException; -import java.util.Map; - -public class FallbackSerializer extends StdSerializer> { - - - public FallbackSerializer() { - this(null); - } - - public FallbackSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(Map value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeString(value.toString()); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java deleted file mode 100644 index 4e42f6851..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/IgnoreTypeMixIn.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonIgnoreType; - -@JsonIgnoreType -public class IgnoreTypeMixIn { -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java deleted file mode 100644 index 3e0b3699e..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDModule.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.databind.module.SimpleModule; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.BigDecimalSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.XMLGregorianCalendarSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.math.BigDecimal; -import java.net.URI; -import java.util.Map; - - -import javax.xml.datatype.XMLGregorianCalendar; - - -/** - * Jackson module which provides support for JSON-LD serialization - */ -public class JsonLDModule extends SimpleModule { - - - public JsonLDModule(Map idMap) { - super(); - - setSerializerModifier(new JsonLDSerializerModifier(idMap)); - - addSerializer(XMLGregorianCalendar.class, new XMLGregorianCalendarSerializer()); - addDeserializer(XMLGregorianCalendar.class, new XMLGregorianCalendarDeserializer()); - addSerializer(BigDecimal.class, new BigDecimalSerializer()); - - addSerializer(URI.class, new UriSerializer()); - addSerializer(LangString.class, new LangStringSerializer()); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java deleted file mode 100644 index d59ef814d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.core.type.WritableTypeId; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import com.fasterxml.jackson.databind.ser.BeanSerializer; -import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.math.BigInteger; -import java.util.*; -import java.util.stream.Stream; - - -public class JsonLDSerializer extends BeanSerializer { - - private final Logger logger = LoggerFactory.getLogger(JsonLDSerializer.class); - - private static int currentRecursionDepth = 0; - - static final Map contextItems = new HashMap<>(); - - private final Map idMap; - - JsonLDSerializer(BeanSerializerBase src, Map idMap) { - super(src); - this.idMap = Objects.requireNonNullElseGet(idMap, HashMap::new); - } - - - - @Override - public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { - gen.setCurrentValue(bean); - - currentRecursionDepth++; - gen.writeStartObject(); - - if (currentRecursionDepth == 1) { - Map filteredContext = new HashMap<>(); - filterContextWrtBean(bean, filteredContext); - gen.writeObjectField("@context", filteredContext); - //gen.writeStringField("@context", "https://jira.iais.fraunhofer.de/stash/projects/ICTSL/repos/ids-infomodel-commons/raw/jsonld-context/3.0.0/context.jsonld"); // only add @context on top level - - } - - if(idMap.containsKey(bean)) - { - gen.writeStringField("@id", idMap.get(bean)); - } - else - { - String randomUri = "https://admin-shell.io/autogen/" + bean.getClass().getSimpleName() + "/" + UUID.randomUUID(); - idMap.put(bean, randomUri); - gen.writeStringField("@id", randomUri); - } - - WritableTypeId typeIdDef = _typeIdDef(typeSer, bean, JsonToken.START_OBJECT); - String resolvedTypeId = typeIdDef.id != null ? typeIdDef.id.toString() : typeSer.getTypeIdResolver().idFromValue(bean); - if (resolvedTypeId != null) { - gen.writeStringField(typeIdDef.asProperty, resolvedTypeId); - } - if (_propertyFilterId != null) { - serializeFieldsFiltered(bean, gen, provider); - } else { - serializeFields(bean, gen, provider); - } - gen.writeEndObject(); - currentRecursionDepth--; - } - - - private void filterContextWrtBean(Object bean, Map filteredContext) { - //Some default entries for AAS - filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); - //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); - - if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion - - //Check if RdfResource or TypedLiteral is used. They contain a field called "type" which can reference to any namespace - //Therefore it is vital to also check the value of the type field for prefixes that need to be included in the context - if(bean.getClass().getSimpleName().equals("LangString")) - { - //LangString is of type rdf:langString, so this must be present - filteredContext.put("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - } - contextItems.forEach((p, u) -> { - JsonTypeName typeNameAnnotation = bean.getClass().getAnnotation(JsonTypeName.class); - if(typeNameAnnotation != null && typeNameAnnotation.value().contains(p)) { - filteredContext.put(p, u); - } - Stream.of(bean.getClass().getMethods()).forEach(m -> { - JsonProperty propertyAnnotation = m.getAnnotation(JsonProperty.class); - if(propertyAnnotation != null && propertyAnnotation.value().contains(p)) { - filteredContext.put(p, u); - } - }); - }); - Stream.of(bean.getClass().getMethods()).forEach(m -> { - // run though all properties and check annotations. These annotations should contain the prefixes - JsonProperty prop = m.getAnnotation(JsonProperty.class); - if(prop != null) - { - for(Map.Entry entry : contextItems.entrySet()) - { - if(prop.value().startsWith(entry.getKey())) - { - filteredContext.put(entry.getKey(), entry.getValue()); - break; - } - } - } - }); - // run through fields recursively - for(Field f : getAllFields(new HashSet<>(), bean.getClass())) { - - if(Collection.class.isAssignableFrom(f.getType())) - { - try { - if(f.getType().getName().startsWith("java.") && !f.getType().getName().startsWith("java.util")) continue; - boolean accessible = f.isAccessible(); - f.setAccessible(true); - Collection c = (Collection) f.get(bean); - if(c == null) { - continue; - } - for(Object o : c) - { - filterContextWrtBean(o, filteredContext); - } - f.setAccessible(accessible); - } - catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - if (f.getType().isPrimitive() || f.getType().isEnum() || f.getType().isArray() - || f.getType().getName().contains("java.") - || f.getType().getName().contains("javax.")) continue; - - try { - boolean wasAccessible = f.isAccessible(); - f.setAccessible(true); - filterContextWrtBean(f.get(bean), filteredContext); - f.setAccessible(wasAccessible); - } catch (IllegalAccessException ignored) { - //logger.error("setting accessible failed"); //We can catch that here, as IllegalReflectiveAccess cannot occur on our own packages - } - - //f.trySetAccessible(wasAccessible); - - } - - } - - /** - * This function retrieves a set of all available fields of a class, including inherited fields - * @param fields Set to which discovered fields will be added. An empty HashSet should do the trick - * @param type The class for which fields should be discovered - * @return set of all available fields - */ - private static Set getAllFields(Set fields, Class type) { - fields.addAll(Arrays.asList(type.getDeclaredFields())); - - if (type.getSuperclass() != null) { - getAllFields(fields, type.getSuperclass()); - } - - return fields; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java deleted file mode 100644 index d998ac5c9..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializerModifier.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import com.fasterxml.jackson.databind.BeanDescription; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializationConfig; -import com.fasterxml.jackson.databind.ser.BeanSerializerModifier; -import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase; - -import java.util.Map; - - -public class JsonLDSerializerModifier extends BeanSerializerModifier { - - private final Map idMap; - - public JsonLDSerializerModifier(Map idMap) { - this.idMap = idMap; - } - - @Override - public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer serializer) { - if (serializer instanceof BeanSerializerBase) { - return new JsonLDSerializer((BeanSerializerBase) serializer, idMap); - } else { - return serializer; - } - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java deleted file mode 100644 index bbcf27772..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLdEnumSerializer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.io.IOException; - -public class JsonLdEnumSerializer extends JsonSerializer> { - - - @Override - public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { - //Generated Enum classes of the admin shell have @IRI annotations, which need to be used to provide proper RDF - if(value.getClass().isEnum() && value.getClass().getName().startsWith("org.eclipse.digitaltwin.aas4j.")) - { - //Try to get annotation value to get the IRI used in the ontology - if(value.getClass().getAnnotation(IRI.class) != null && value.getClass().getAnnotation(IRI.class).value().length > 0) - { - gen.writeStartObject(); - gen.writeStringField("@type", value.getClass().getAnnotation(IRI.class).value()[0]); - - //Try to extract exact IRI of the enum value, if present - try { - var annotation = value.getClass().getField(value.name()).getAnnotation(IRI.class); - if(annotation != null && annotation.value().length > 0) - { - gen.writeStringField("@id", annotation.value()[0]); - } - else - { - //Didn't find an @IRI annotation - fall back to using class annotation + field name - gen.writeStringField("@id", translate(value.getClass(), value.name())); - } - } - //Should be impossible - catch (NoSuchFieldException e) - { - //Didn't find an @IRI annotation - fall back to using class annotation + field name - gen.writeStringField("@id", translate(value.getClass(), value.name())); - } - gen.writeEndObject(); - } - else - { - gen.writeString(translate(value.getClass(), value.name())); - } - - - } else { - provider.findValueSerializer(Enum.class).serialize(value, gen, provider); - } - } - - - - public static String translate(Class enumClass, String input) { - String[] iriValues = enumClass.getAnnotation(IRI.class).value(); - String result = ""; - if(iriValues.length > 0) - { - result = iriValues[0]; - if(!result.endsWith("/")) - { - result += "/"; - } - } - result += input; - return result; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java deleted file mode 100644 index 53a03bb85..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/LangStringSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import java.io.IOException; - - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringSerializer extends StdSerializer { - - - public LangStringSerializer() { - this(null); - } - - public LangStringSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(LangString value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeStartObject(); - if(value.getLanguage() != null && !value.getLanguage().isEmpty()) - { - gen.writeStringField("@language", value.getLanguage()); - } - else - { - gen.writeStringField("@type", "rdf:langString"); - } - gen.writeStringField("@value", value.getText()); - gen.writeEndObject(); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java deleted file mode 100644 index 80582d6b5..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Parser.java +++ /dev/null @@ -1,1171 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; -import org.apache.jena.datatypes.DatatypeFormatException; -import org.apache.jena.query.*; -import org.apache.jena.rdf.model.*; -import org.apache.jena.riot.Lang; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; -import org.apache.jena.riot.RiotException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.lang.reflect.*; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.ZonedDateTime; -import java.time.format.DateTimeParseException; -import java.util.*; -import java.util.stream.Collectors; - - -/** - * Internal class to handle the parsing of JSON-LD into java objects - * @author maboeckmann - */ -class Parser { - - private final Logger logger = LoggerFactory.getLogger(Parser.class); - - private static final URI blankNodeIdPropertyUri = URI.create("https://admin-shell.io/aas/blankNodeId"); - - static Map knownNamespaces = new HashMap<>(); - - /** - * Main internal method for creating a java object from a given RDF graph and a URI of the object to handle - * @param inputModel Model on which queries are to be evaluated from which information can be retrieved - * @param objectUri URI of the object to be handled - * @param targetClass Variable containing the class which should be returned - * @param Class which should be returned - * @return Object of desired class, filled with the values extracted from inputModel - * @throws IOException thrown if the parsing fails - */ - private T handleObject(Model inputModel, String objectUri, Class targetClass) throws IOException { - try { - - //if(!targetClass.getSimpleName().endsWith("Impl")) //This would not work for "TypedLiteral", "RdfResource" and so on - //Check whether we are dealing with an instantiable class (i.e. no interface and no abstract class) - boolean currentObjectIsBlankNode = false; - if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { - //We don't know the desired class yet (current targetClass is not instantiable). This is only known for the root object - ArrayList> implementingClasses = getImplementingClasses(targetClass); - String queryString; - //Get a list of all "rdf:type" statements in our model - //In case of a blank node, the "object URI" will just be a string and no valid URI. In that case, we need a different query syntax - try { - new URL(objectUri); - } - catch (MalformedURLException e) - { - currentObjectIsBlankNode = true; - } - if(currentObjectIsBlankNode) - { - //Object is a blank node, so the subject URI cannot be used - queryString = "SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> \"" + objectUri + "\" ; a ?type . }"; - } - else - { - //Not a blank node, so we can work with the subject URI - queryString = "SELECT ?type { BIND(<" + objectUri + "> AS ?s). ?s a ?type . }"; - } - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); - ResultSet resultSet = queryExecution.execSelect(); - - if (!resultSet.hasNext()) { - queryExecution.close(); - throw new IOException("Could not extract class of child object. ID: " + objectUri); - } - - //Class candidateClass = null; - - String fullName = "No triple present indicating type."; - while (resultSet.hasNext()) { - QuerySolution solution = resultSet.nextSolution(); - fullName = solution.get("type").toString(); - - //Expected URI is something like https://w3id.org/idsa/core/ClassName (and we want ClassName) - String className = fullName.substring(fullName.lastIndexOf('/') + 1); - - //Some namespaces use "#" instead of "/" - if (className.contains("#")) { - className = className.substring(className.lastIndexOf("#") + 1); - } - - for (Class currentClass : implementingClasses) { - //Is this class instantiable? - if (!currentClass.isInterface() && !Modifier.isAbstract(currentClass.getModifiers())) { - //candidateClass = currentClass; - if (currentClass.getSimpleName().equals(className) || currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { - targetClass = (Class) currentClass; - break; - } - } - } - } - queryExecution.close(); - //Did we find "the" class, i.e. instantiable and name matches? - if (targetClass.isInterface() || Modifier.isAbstract(targetClass.getModifiers())) { - //No, the current targetClass cannot be instantiated. Do we have a candidate class? - //if (candidateClass != null) { - throw new IOException("Did not find an instantiable class for " + objectUri + " matching expected class name (" + targetClass.getSimpleName() + "). Object has type: " + fullName); - //targetClass = (Class) candidateClass; - //} - } - } - - //Enums have no constructors - if(targetClass.isEnum()) - { - return handleEnum(targetClass, objectUri); - } - - //Get constructor (which is package private for our classes) and make it accessible - Constructor constructor = targetClass.getDeclaredConstructor(); - constructor.setAccessible(true); - - //Instantiate new object, which will be returned at the end - T returnObject = constructor.newInstance(); - - //Get methods - Method[] methods = returnObject.getClass().getDeclaredMethods(); - - //Store methods in map. Key is the name of the RDF property without ids prefix - Map methodMap = new HashMap<>(); - - //Get all relevant methods (setters, but not for label, comment or external properties) - Arrays.stream(methods).filter(method -> { - String name = method.getName(); - //Filter out irrelevant methods - return name.startsWith("set") && !name.equals("setProperty") && !name.equals("setComment") && !name.equals("setLabel"); // && !name.equals("setId"); - }).forEach(method -> { - //Remove "set" part - String reducedName = method.getName().substring(3); - - //Turn first character to lower case - char[] c = reducedName.toCharArray(); - c[0] = Character.toLowerCase(c[0]); - String finalName = new String(c); - methodMap.put(finalName, method); - - }); - - //There is no "setId" method in our CodeGen generated classes, so we get the field - /* TODO: No "id" field yet - Field idField = returnObject.getClass().getDeclaredField("id"); - - //Store whether or not it was accessible, so that we can undo making it accessible - boolean wasAccessible = idField.isAccessible(); - idField.setAccessible(true); - - //Set the ID of the object to be identical with the objectUri parameter - idField.set(returnObject, new URI(objectUri)); - idField.setAccessible(wasAccessible); - */ - - //Is this a trivial class with 0 fields? If so, the generated query would be "SELECT { }", which is illegal - if(methodMap.isEmpty()) - { - return returnObject; - } - - - //A list which stores all those parameter names which may occur only once (i.e. those occurring in the GROUP BY clause) - List groupByKeys = new ArrayList<>(); - - StringBuilder queryStringBuilder = new StringBuilder(); - - for(Map.Entry entry : knownNamespaces.entrySet()) - { - queryStringBuilder.append("PREFIX ").append(entry.getKey()); - if(!entry.getKey().endsWith(":")) - { - queryStringBuilder.append(":"); - } - queryStringBuilder.append(" <").append(entry.getValue()).append(">\n"); - } - queryStringBuilder.append("SELECT"); - methodMap.forEach((key1, value) -> { - //Is the return type some sort of List? - if (Collection.class.isAssignableFrom(value.getParameterTypes()[0])) { - boolean isTypedLiteral = false; - //Yes, it is assignable multiple times. Concatenate multiple values together using some delimiter - try { - //ArrayLists are generics. We need to extract the name of the generic parameter as string and interpret that - String typeName = extractTypeNameFromCollection(value.getGenericParameterTypes()[0]); - - if (typeName.endsWith("LangString")) - isTypedLiteral = true; - } catch (IOException e) { - e.printStackTrace(); - } - if (isTypedLiteral) { - queryStringBuilder.append(" (GROUP_CONCAT(CONCAT('\"',?").append(key1).append(",'\"@', lang(?").append(key1).append("));separator=\"||\") AS ?").append(key1).append("sLang) "); - } - queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append(";separator=\"||\") AS ?").append(key1).append("s) "); - - //Additional case for blank nodes - queryStringBuilder.append(" (GROUP_CONCAT(?").append(key1).append("Blank;separator=\"||\") AS ?").append(key1).append("sBlank) "); - - - } else { - //No, it's not a list. No need to aggregate - queryStringBuilder.append(" ?").append(key1); - //We will have to GROUP BY this variable though... - groupByKeys.add(key1); - } - }); - //Start the "WHERE" part - Fuseki does not expect the "WHERE" keyword, but just an "{" - queryStringBuilder.append(" { "); - - //In case of blank nodes, we can't work with the subject URI - if(currentObjectIsBlankNode) - { - queryStringBuilder.append("?s <").append(blankNodeIdPropertyUri).append("> \"").append(objectUri).append("\" ;"); - } - else - { - queryStringBuilder.append(" <").append(objectUri).append(">"); - } - - //Make sure that the object is of the correct type - //This is particularly relevant in case of all fields being optional -- then one could simply parse a random object - queryStringBuilder.append(" a ").append(wrapIfUri(targetClass.getAnnotation(IRI.class).value()[0])).append(". "); - - for (Map.Entry entry : methodMap.entrySet()) { - //Is this a field which is annotated by NOT NULL? - //Attempt to find a field matching the setter method name - //E.g. for "setSomething", we search for a field with name "_something" (IDS way) and "something" - Field field = getFieldByName(targetClass, entry.getKey()); - - - //In AAS, every field is optional, as there are no validation annotations in the model - queryStringBuilder.append(" OPTIONAL {"); - - if(currentObjectIsBlankNode) - { - queryStringBuilder.append(" ?s "); - } - else { - queryStringBuilder.append(" <").append(objectUri).append("> "); //subject, as passed to the function - } - //For the field, get the JsonAlias annotation (present for all classes generated by the CodeGen tool) - //Find the annotation value containing a colon and interpret this as "prefix:predicate" - boolean foundAnnotation = false; - if(field.getAnnotation(IRI.class) != null) { - Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).map(this::wrapIfUri).filter(annotation -> annotation.contains(":")).findFirst(); - currentAnnotation.ifPresent(queryStringBuilder::append); - foundAnnotation = true; - } - if(!foundAnnotation) - { - logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); - queryStringBuilder.append("aas:").append(entry.getKey()); - } - //if(isBlank(?entry.getKey(), use value of artificial, use original value) - queryStringBuilder.append(" ?").append(entry.getKey()).append(" ."); //object - - //In case of the object being a blank node, we construct a second result variable with the blank node id - queryStringBuilder.append("OPTIONAL { ?").append(entry.getKey()).append(" <").append(blankNodeIdPropertyUri).append("> ?").append(entry.getKey()).append("Blank . } "); - - queryStringBuilder.append("} "); - } - - - queryStringBuilder.append(" } "); - - //Do we need to group? We do, if there is at least one property which can occur multiple times - //We added all those properties, which may only occur once, to the groupByKeys list - if (!groupByKeys.isEmpty()) { - queryStringBuilder.append("GROUP BY"); - for (String key : groupByKeys) { - queryStringBuilder.append(" ?").append(key); - } - } - - String queryString = queryStringBuilder.toString(); - - StringBuilder queryForOtherProperties = new StringBuilder(); - //Query for all unknown properties and their values - //Select properties and values only - - if(!targetClass.equals(LangString.class)) { //LangString has no additional properties map. Skip this step - - //CONSTRUCT { ?s ?p ?o } { ?s ?p ?o. FILTER(?p NOT IN (list of ids properties)) } - for (Map.Entry entry : knownNamespaces.entrySet()) { - queryForOtherProperties.append("PREFIX ").append(entry.getKey()); - if (!entry.getKey().endsWith(":")) { - queryForOtherProperties.append(":"); - } - queryForOtherProperties.append(" <").append(entry.getValue()).append(">\n"); - } - - - //Respect ALL properties and values - queryForOtherProperties.append(" SELECT ?p ?o { <").append(objectUri).append("> ?p ?o .\n"); - - //Exclude known properties - queryForOtherProperties.append("FILTER (?p NOT IN (rdf:type"); - - //Predicates usually look like: .append("ids:").append(entry.getKey()) - for (Map.Entry entry : methodMap.entrySet()) { - queryForOtherProperties.append(", "); - - Field field = getFieldByName(targetClass, entry.getKey()); - Optional currentAnnotation = Arrays.stream(field.getAnnotation(IRI.class).value()).filter(annotation -> annotation.contains(":")).filter(s -> s.length() > 1).findFirst(); - if (currentAnnotation.isPresent()) { - queryForOtherProperties.append(wrapIfUri(currentAnnotation.get())); - } else { - logger.warn("Failed to retrieve JsonAlias for field " + field + ". Assuming aas:" + entry.getKey()); - queryForOtherProperties.append("aas:").append(entry.getKey()); - } - } - - queryForOtherProperties.append(")). } "); - - - //Now that we searched for all "known properties", let's search for all unrecognized content and append it to a generic properties map - - Query externalPropertiesQuery = QueryFactory.create(queryForOtherProperties.toString()); - QueryExecution externalPropertiesQueryExecution = QueryExecutionFactory.create(externalPropertiesQuery, inputModel); - ResultSet externalPropertiesResultSet = externalPropertiesQueryExecution.execSelect(); - - // now as all declared instances and classes are treated, which are also represented in the respective java - // dependency, take care about the ones within foreign namespaces and add those to the 'properties' field - // note that not all models (e.g. AAS) have such methods. In case they do not exist, skip adding external properties - - try { - Method setProperty = returnObject.getClass().getDeclaredMethod("setProperty", String.class, Object.class); - Method getProperties = returnObject.getClass().getDeclaredMethod("getProperties"); - - while (externalPropertiesResultSet.hasNext()) { - QuerySolution externalPropertySolution = externalPropertiesResultSet.next(); - - HashMap currentProperties = (HashMap) getProperties.invoke(returnObject); - - //Avoid NullPointerException - if (currentProperties == null) { - currentProperties = new HashMap<>(); - } - - String propertyUri = externalPropertySolution.get("p").toString(); - - //Does this key already exist? If yes, we need to store the value as array to not override them - if (currentProperties.containsKey(propertyUri)) { - //If it is not an array list yet, turn it into one - if (!(currentProperties.get(propertyUri) instanceof ArrayList)) { - ArrayList newList = new ArrayList<>(); - newList.add(currentProperties.get(propertyUri)); - currentProperties.put(propertyUri, newList); - } - } - - //Literals and complex objects need to be handled differently - //Literals can be treated as flat values, whereas complex objects require recursive calls - if (externalPropertySolution.get("o").isLiteral()) { - Object o = handleForeignLiteral(externalPropertySolution.getLiteral("o")); - //If it is already an ArrayList, add new value to it - if (currentProperties.containsKey(propertyUri)) { - ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); - currentPropertyArray.add(o); - setProperty.invoke(returnObject, propertyUri, currentPropertyArray); - } - //Otherwise save as new plain value - else { - setProperty.invoke(returnObject, propertyUri, o); - } - } else { - //It is a complex object. Distinguish whether or not we need to store as array - HashMap subMap = handleForeignNode(externalPropertySolution.getResource("o"), new HashMap<>(), inputModel); - subMap.put("@id", externalPropertySolution.getResource("o").getURI()); - if (currentProperties.containsKey(propertyUri)) { - ArrayList currentPropertyArray = ((ArrayList) currentProperties.get(propertyUri)); - currentPropertyArray.add(subMap); - setProperty.invoke(returnObject, propertyUri, currentPropertyArray); - } else { - setProperty.invoke(returnObject, propertyUri, subMap); - } - } - } - externalPropertiesQueryExecution.close(); - } - catch (NoSuchMethodException ignored) - { - //Method does not exist, skip - } - } - - - - Query query; - try { - query = QueryFactory.create(queryString); - } - catch (QueryParseException e) - { - logger.error(queryString); - throw e; - } - - //Evaluate query - QueryExecution queryExecution = QueryExecutionFactory.create(query, inputModel); - ResultSet resultSet = queryExecution.execSelect(); - - - if (!resultSet.hasNext()) { - queryExecution.close(); - //no content... - return returnObject; - } - - //SPARQL binding present, iterate over result and construct return object - while (resultSet.hasNext()) { - QuerySolution querySolution = resultSet.next(); - - //Check if there are fields which have more values than allowed - if (resultSet.hasNext()) { - String value1 = "", value2 = "", parameterName = ""; - QuerySolution querySolution2 = resultSet.next(); - Iterator varNamesIt = querySolution2.varNames(); - while(varNamesIt.hasNext()) - { - String varName = varNamesIt.next(); - if(querySolution.contains(varName)) - { - if(!querySolution.get(varName).equals(querySolution2.get(varName))) - { - parameterName = varName; - value1 = querySolution.get(varName).toString(); - value2 = querySolution2.get(varName).toString(); - break; - } - } - } - if(!value1.isEmpty()) - { - throw new IOException(objectUri + " has multiple values for " + parameterName + ", which is not allowed. Values are: " + value1 + " and " + value2); - } - throw new IOException("Multiple bindings for SPARQL query which should only have one binding. Input contains multiple values for a field which may occur only once."); - } - - //No value occurs more often than allowed - for (Map.Entry entry : methodMap.entrySet()) { - - //What is this method setting? Get the expected parameter type and check whether it is some complex sub-object and whether this is a list - Class currentType = entry.getValue().getParameterTypes()[0]; - - String sparqlParameterName = entry.getKey(); - - if (Collection.class.isAssignableFrom(currentType)) { - sparqlParameterName += "s"; //plural form for the concatenated values - } - if(!querySolution.contains(sparqlParameterName)) - { - sparqlParameterName += "Blank"; //If not present, try to go with the option for blank nodes instead - //TODO: Note: This would not yield full results yet in case some of the values are encapsulated - // in blank nodes and some are not, for the same property - } - if (querySolution.contains(sparqlParameterName)) { - String currentSparqlBinding = querySolution.get(sparqlParameterName).toString(); - - boolean objectIsBlankNode = querySolution.get(sparqlParameterName).isResource() && querySolution.get(sparqlParameterName).asNode().isBlank(); - String blankNodeId = ""; - //If the object is a blank node, we will struggle to make follow-up queries starting at the blank node as subject - //For that case, we add some artificial identifiers here - if(objectIsBlankNode) { - blankNodeId = querySolution.get(sparqlParameterName).asNode().getBlankNodeId().toString(); - } - if (currentType.isEnum()) { - //Two possibilities: - //1: The URI of the enum value is given directly e.g. ?s ?p - //2: The URI of the enum value is encapsulated in a blank node, e.g. - // ?s ?p [ a demo:myEnum, demo:enumValue ] - if(objectIsBlankNode) - { - - Query innerEnumQuery = QueryFactory.create("SELECT ?type { ?s <" + blankNodeIdPropertyUri + "> + \"" + blankNodeId + "\" ; a ?type } "); - QueryExecution innerEnumQueryExecution = QueryExecutionFactory.create(innerEnumQuery, inputModel); - ResultSet innerEnumQueryExecutionResultSet = innerEnumQueryExecution.execSelect(); - - //Only throw this if there is no successful execution - IOException anyIOException = null; - boolean oneSuccessfulEnumFound = false; - while(innerEnumQueryExecutionResultSet.hasNext()) - { - try { - entry.getValue().invoke(returnObject, handleEnum(currentType, innerEnumQueryExecutionResultSet.next().get("type").toString())); - oneSuccessfulEnumFound = true; - break; //Stop after the first successful execution - } - catch (IOException e) //There might be errors, if multiple types are present, see example above - { - anyIOException = e; - } - } - //If nothing worked, but something failed (i.e. there exists a problematic element, but no proper element), we throw an exception - if(anyIOException != null && !oneSuccessfulEnumFound) - throw new IOException("Could not parse Enum. ", anyIOException); - innerEnumQueryExecution.close(); - } - else { - entry.getValue().invoke(returnObject, handleEnum(currentType, currentSparqlBinding)); - } - continue; - } - - - //There is a binding. If it is a complex sub-object, we need to recursively call this function - if (Collection.class.isAssignableFrom(currentType)) { - //We are working with ArrayLists. - //Here, we need to work with the GenericParameterTypes instead to find out what kind of ArrayList we are dealing with - String typeName = extractTypeNameFromCollection(entry.getValue().getGenericParameterTypes()[0]); - if (isArrayListTypePrimitive(entry.getValue().getGenericParameterTypes()[0])) { - if (typeName.endsWith("LangString")) { - try { - currentSparqlBinding = querySolution.get(sparqlParameterName + "Lang").toString(); - } catch (NullPointerException e) { - //logger.warn("Failed to retrieve localized/typed values of " + currentSparqlBinding + ". Make sure that namespaces used in this property are known and valid. Proceeding without localized values and interpreting as string."); - //logger.warn("Query was: " + queryString); - //logger.warn("Attempted to fetch: " + sparqlParameterName + "Lang"); - } - } - ArrayList list = new ArrayList<>(); - //Two pipes were used as delimiter above - //Introduce set to deduplicate - Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); - for (String s : allElements) { - Literal literal; - //querySolution.get(sparqlParameterName). - if (s.endsWith("@")) { - s = s.substring(2, s.length() - 3); - literal = ResourceFactory.createStringLiteral(s); - } else if (s.startsWith("\\")) { - //turn something like \"my Desc 1\"@en to "my Desc 1"@en - s = s.substring(1).replace("\\\"@", "\"@"); - literal = ResourceFactory.createLangLiteral(s.substring(1, s.lastIndexOf("@") - 1), s.substring(s.lastIndexOf("@") + 1)); - } else { - literal = ResourceFactory.createPlainLiteral(s); - } - - //Is the type of the ArrayList some built in Java primitive? - - if (builtInMap.containsKey(typeName)) { - //Yes, it is. We MUST NOT call Class.forName(name)! - list.add(handlePrimitive(builtInMap.get(typeName), literal, null)); - } else { - //Not a Java primitive, we may call Class.forName(name) - list.add(handlePrimitive(Class.forName(typeName), literal, s)); - } - } - entry.getValue().invoke(returnObject, list); - } else { - //List of complex sub-objects, such as a list of Resources in a ResourceCatalog - ArrayList list = new ArrayList<>(); - Set allElements = new HashSet<>(Arrays.asList(currentSparqlBinding.split("\\|\\|"))); - for (String s : allElements) { - if (Class.forName(typeName).isEnum()) { - list.add(handleEnum(Class.forName(typeName), s)); - } else { - list.add(handleObject(inputModel, s, Class.forName(typeName))); - } - } - entry.getValue().invoke(returnObject, list); - } - } - - //Not an ArrayList of objects expected, but rather one object - else { - //Our implementation of checking for primitives (i.e. also includes URLs, Strings, XMLGregorianCalendars, ...) - if (isPrimitive(currentType)) { - - Literal literal = null; - try { - literal = querySolution.getLiteral(sparqlParameterName); - } catch (Exception ignored) { - } - - entry.getValue().invoke(returnObject, handlePrimitive(currentType, literal, currentSparqlBinding)); - - } else { - //Not a primitive object, but a complex sub-object. Recursively call this function to handle it - if (objectIsBlankNode) { - entry.getValue().invoke(returnObject, handleObject(inputModel, blankNodeId, entry.getValue().getParameterTypes()[0])); - } else { - - entry.getValue().invoke(returnObject, handleObject(inputModel, currentSparqlBinding, entry.getValue().getParameterTypes()[0])); - } - } - } - } - - } - } - queryExecution.close(); - - return returnObject; - } catch (NoSuchMethodException | NullPointerException | IllegalAccessException | InstantiationException | InvocationTargetException | NoSuchFieldException | URISyntaxException | DatatypeConfigurationException | ClassNotFoundException e) { - throw new IOException("Failed to instantiate desired class (" + targetClass.getName() + ")", e); - } - } - - /** - * This function wraps a URI with "<" ">", if needed, to avoid errors about "unknown namespace http(s):" - * @param input Input URI, possibly a prefixed value - * @return If this is a full URI, starting with http or https, the URI will be encapsulated in "<" ">" - */ - private String wrapIfUri(String input) - { - if(input.startsWith("http://") || input.startsWith("https://")) - { - return "<" + input + ">"; - } - else { - return input; - } - } - - private Object handleForeignLiteral(Literal literal) throws URISyntaxException { - if(literal.getLanguage() != null && !literal.getLanguage().equals("")) - { - return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); - } - //If not, does it have some datatype URI? - //else if(literal.getDatatypeURI() != null && !literal.getDatatypeURI().equals("")) - //{ - // return new TypedLiteral(literal.getString(), new URI(literal.getDatatypeURI())); - //} - //If both is not true, add it as normal string - else - { - return literal.getString(); - } - } - - private HashMap handleForeignNode(RDFNode node, HashMap map, Model model) throws IOException, URISyntaxException { - //Make sure it is not a literal. If it were, we would not know the property name and could not add this to the map - //Literals must be handled "one recursion step above" - if(node.isLiteral()) - { - throw new IOException("Literal passed to handleForeignNode. Must be non-literal RDF node"); - } - - //Run SPARQL query retrieving all information (only one hop!) about this node - String queryString = "SELECT ?s ?p ?o { BIND(<" + node.asNode().getURI() + "> AS ?s) . ?s ?p ?o . } "; - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, model); - ResultSet resultSet = queryExecution.execSelect(); - - - - //Handle outgoing properties of this foreign node - while(resultSet.hasNext()) - { - QuerySolution querySolution = resultSet.next(); - - String propertyUri = querySolution.get("p").toString(); - - if(map.containsKey(propertyUri)) { - //If it is not an array list yet, turn it into one - if (!(map.get(propertyUri) instanceof ArrayList)) { - ArrayList newList = new ArrayList<>(); - newList.add(map.get(propertyUri)); - map.put(propertyUri, newList); - } - } - - //Check the type of object we have. If it is a literal, just add it as "flat value" to the map - if(querySolution.get("o").isLiteral()) - { - //Handle some small literal. This function will turn this into a TypedLiteral if appropriate - Object o = handleForeignLiteral(querySolution.getLiteral("o")); - if(map.containsKey(propertyUri)) - { - map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(o)); - } - else - { - map.put(querySolution.get("p").toString(), o); - } - } - - //If it is not a literal, we need to call this function recursively. Create new map for sub object - else - { - //logger.info("Calling handleForeignNode for " + querySolution.getResource("o").toString()); - if(querySolution.getResource("s").toString().equals(querySolution.getResource("o").toString())) - { - logger.warn("Found self-reference on " + querySolution.getResource("s").toString() + " via predicate " + querySolution.getResource("p").toString() + " ."); - continue; - } - HashMap subMap = handleForeignNode(querySolution.getResource("o"), new HashMap<>(), model); - subMap.put("@id", querySolution.getResource("o").getURI()); - if(map.containsKey(propertyUri)) - { - map.put(querySolution.get("p").toString(), ((ArrayList)map.get(propertyUri)).add(subMap)); - } - else { - map.put(querySolution.get("p").toString(), subMap); - } - } - } - queryExecution.close(); - return map; - } - - - /** - * Utility function, used to obtain the field corresponding to a setter function - * @param targetClass Class object in which we search for a field - * @param fieldName Guessed name of the field to search for - * @return Field object matching the name (possibly with leading underscore) - * @throws NoSuchFieldException thrown, if no such field exists - */ - private Field getFieldByName(Class targetClass, String fieldName) throws NoSuchFieldException { - try { - return targetClass.getDeclaredField("_" + fieldName); - } catch (NoSuchFieldException e) { - try { - return targetClass.getDeclaredField(fieldName); - } catch (NoSuchFieldException e2) { - try { - return targetClass.getDeclaredField("_" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1)); - } - catch (NoSuchFieldException e3) - { - throw new NoSuchFieldException("Failed to find field which is set by method " + fieldName); - } - } - } - } - - /** - * Internal function to create a single enum object from a given desired class and a URL - * @param enumClass The enum class - * @param url The URL of the enum value - * @param Enum class - * @return Value of enumClass matching the input URL - * @throws IOException thrown if no matching enum value could be found - */ - private T handleEnum(Class enumClass, String url) throws IOException { - if (!enumClass.isEnum()) { - throw new RuntimeException("Non-Enum class passed to handleEnum function."); - } - T[] constants = enumClass.getEnumConstants(); - if(url.contains("/")) - { - url = url.substring(url.lastIndexOf("/") + 1); - } - for (T constant : constants) { - //We artificially added some underscores in the AAS ontology. TODO: This might be a bit dangerous for other ontologies, which really contain underscores in enum names - if (url.equalsIgnoreCase(constant.toString()) || url.equalsIgnoreCase(constant.toString().replace("_", ""))) { - return constant; - } - } - throw new IOException("Failed to find matching enum value for " + url + " . Available enums are: " + Arrays.stream(constants).map(Object::toString).collect(Collectors.joining(", "))); - } - - /** - * Function for handling a rather primitive object, i.e. not a complex sub-object (e.g. URI, TypedLiteral, GregorianCalendar values, ...) - * @param currentType Input Class (or primitive) - * @param literal Value as literal (can be null in some cases) - * @param currentSparqlBinding Value as SPARQL Binding (can be null in some cases) - * @return Object of type currentType - * @throws URISyntaxException thrown, if currentType is URI, but the value cannot be parsed to a URI - * @throws DatatypeConfigurationException thrown, if currentType is XMLGregorianCalendar or Duration, but parsing fails - * @throws IOException thrown, if no matching "simple class" could be found - */ - private Object handlePrimitive(Class currentType, Literal literal, String currentSparqlBinding) throws URISyntaxException, DatatypeConfigurationException, IOException { - //Java way of checking for primitives, i.e. int, char, float, double, ... - if (currentType.isPrimitive()) { - if (literal == null) { - throw new IOException("Trying to handle Java primitive, but got no literal value"); - } - //If it is an actual primitive, there is no need to instantiate anything. Just give it to the function - switch (currentType.getSimpleName()) { - case "int": - return literal.getInt(); - case "boolean": - return literal.getBoolean(); - case "long": - return literal.getLong(); - case "short": - return literal.getShort(); - case "float": - return literal.getFloat(); - case "double": - return literal.getDouble(); - case "byte": - return literal.getByte(); - } - } - - //Check for the more complex literals - - //URI - if (URI.class.isAssignableFrom(currentType)) { - return new URI(currentSparqlBinding); - } - - //String - if (String.class.isAssignableFrom(currentType)) { - return currentSparqlBinding; - } - - //XMLGregorianCalendar - if (XMLGregorianCalendar.class.isAssignableFrom(currentType)) { - //Try parsing this as dateTimeStamp (most specific). If seconds / timezone is missing, DatatypeFormatException will be thrown - try { - return DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(literal.getValue().toString()))); - } - catch (DatatypeFormatException | DateTimeParseException ignored) - { - //Not a valid dateTimeStamp. Try parsing just to Date - try { - Date date = new SimpleDateFormat().parse(literal.getValue().toString()); - GregorianCalendar calendar = new GregorianCalendar(); - calendar.setTime(date); - return DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar); - } - catch (ParseException | DateTimeParseException | DatatypeFormatException e2) - { - //Do NOT use literal.getValue(), as that can already cause yet another DatatypeFormatException - throw new IOException("Could not turn " + literal.getString() + " into " + literal.getDatatypeURI(), e2); - } - } - } - - //TypedLiteral - if (LangString.class.isAssignableFrom(currentType)) { - //Either a language tagged string OR literal with type. Only one allowed - if (!literal.getLanguage().equals("")) { - return new DefaultLangString.Builder().text(literal.getValue().toString()).language(literal.getLanguage()).build(); - } - return new DefaultLangString.Builder().text(currentSparqlBinding).language("en-us").build(); // TODO: find a better language tag - } - - //BigInteger - if (BigInteger.class.isAssignableFrom(currentType)) { - return new BigInteger(literal.getString()); - } - - //BigDecimal - if (BigDecimal.class.isAssignableFrom(currentType)) { - return new BigDecimal(literal.getString()); - } - - //byte[] - if (byte[].class.isAssignableFrom(currentType)) { - return currentSparqlBinding.getBytes(); - } - - //Duration - if (Duration.class.isAssignableFrom(currentType)) { - return DatatypeFactory.newInstance().newDuration(currentSparqlBinding); - } - - throw new IOException("Unrecognized primitive type: " + currentType.getName()); - } - - /** - * This list contains all primitive Java types - */ - private final Map> builtInMap = new HashMap<>(); - { - builtInMap.put("int", Integer.TYPE); - builtInMap.put("long", Long.TYPE); - builtInMap.put("double", Double.TYPE); - builtInMap.put("float", Float.TYPE); - builtInMap.put("bool", Boolean.TYPE); - builtInMap.put("char", Character.TYPE); - builtInMap.put("byte", Byte.TYPE); - builtInMap.put("void", Void.TYPE); - builtInMap.put("short", Short.TYPE); - } - - private boolean isArrayListTypePrimitive(Type t) throws IOException { - String typeName = extractTypeNameFromCollection(t); - - try { - //Do not try to call Class.forName(primitive) -- that would throw an exception - if (builtInMap.containsKey(typeName)) return true; - return isPrimitive(Class.forName(typeName)); - } catch (ClassNotFoundException e) { - throw new IOException("Unable to retrieve class from generic", e); - } - } - - private String extractTypeNameFromCollection(Type t) throws IOException { - String typeName = t.getTypeName(); - if (!typeName.startsWith("java.util.ArrayList<") && !typeName.startsWith("java.util.List<") && !typeName.startsWith("java.util.Collection<")) { - throw new IOException("Illegal argument encountered while interpreting type parameter"); - } - //"" or super instead of extends - if(typeName.contains("?")) - { - //last space is where we want to cut off (right after the "extends"), as well as removing the last closing braces - return typeName.substring(typeName.lastIndexOf(" ") + 1, typeName.length() - 1); - } - //No extends - else - { - return typeName.substring(typeName.indexOf("<") + 1, typeName.indexOf(">")); - } - } - - private boolean isPrimitive(Class input) throws IOException { - //Collections are not simple - if (Collection.class.isAssignableFrom(input)) { - throw new IOException("Encountered collection in isPrimitive. Use isArrayListTypePrimitive instead"); - } - - //check for: plain/typed literal, XMLGregorianCalendar, byte[], RdfResource - //covers int, long, short, float, double, boolean, byte - if (input.isPrimitive()) return true; - - return (URI.class.isAssignableFrom(input) || - String.class.isAssignableFrom(input) || - XMLGregorianCalendar.class.isAssignableFrom(input) || - LangString.class.isAssignableFrom(input) || - BigInteger.class.isAssignableFrom(input) || - BigDecimal.class.isAssignableFrom(input) || - byte[].class.isAssignableFrom(input) || - Duration.class.isAssignableFrom(input)); - } - - /** - * Entry point to this class. Takes an RDF Model and a desired target class (can be an interface) - * @param rdfModel RDF input to be parsed - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(Model rdfModel, Class targetClass) throws IOException { - addArtificialBlankNodeLabels(rdfModel); - ArrayList> implementingClasses = getImplementingClasses(targetClass); - - // Query to retrieve all instances in the input graph that have a class assignment - // Assumption: if the class name (?type) is equal to the target class, this should be the - // instance we actually want to parse - String queryString = "SELECT ?id ?type { ?id a ?type . }"; - Query query = QueryFactory.create(queryString); - QueryExecution queryExecution = QueryExecutionFactory.create(query, rdfModel); - ResultSet resultSet = queryExecution.execSelect(); - - if (!resultSet.hasNext()) { - throw new IOException("Could not extract class from input message"); - } - - Map> returnCandidates = new HashMap<>(); - - while (resultSet.hasNext()) { - QuerySolution solution = resultSet.nextSolution(); - String fullName = solution.get("type").toString(); - String className = fullName.substring(fullName.lastIndexOf('/') + 1); - - //In case of hash-namespaces - if(className.contains("#")) { - className = className.substring(className.lastIndexOf("#")); - } - - //For legacy purposes... - if (className.startsWith("ids:") || className.startsWith("aas:")) { - className = className.substring(4); - } - - for (Class currentClass : implementingClasses) { - if (currentClass.getSimpleName().equals(Serializer.implementingClassesNamePrefix + className + Serializer.implementingClassesNameSuffix)) { - returnCandidates.put(solution.get("id").toString(), currentClass); - } - } - //if (returnCandidates.size() > 0) break; - } - queryExecution.close(); - - if (returnCandidates.size() == 0) { - throw new IOException("Could not transform input to an appropriate implementing class for " + targetClass.getName()); - } - - //At this point, we parsed the model and know to which implementing class we want to parse - //Check if there are several options available - if(returnCandidates.size() > 1) - { - String bestCandidateId = null; - Class bestCandidateClass = null; - long bestNumRelations = -1L; - for(Map.Entry> entry : returnCandidates.entrySet()) - { - String determineBestCandidateQueryString = "CONSTRUCT { ?s ?p ?o . ?o ?p2 ?o2 . ?o2 ?p3 ?o3 . ?o3 ?p4 ?o4 . ?o4 ?p5 ?o5 . }" + - " WHERE {" + - " BIND(<" + entry.getKey() + "> AS ?s). ?s ?p ?o ." + - " OPTIONAL {?o ?p2 ?o2 . OPTIONAL {?o2 ?p3 ?o3 . OPTIONAL {?o3 ?p4 ?o4 . OPTIONAL {?o4 ?p5 ?o5 . } } } } }"; - Query determineBestCandidateQuery = QueryFactory.create(determineBestCandidateQueryString); - QueryExecution determineBestCandidateQueryExecution = QueryExecutionFactory.create(determineBestCandidateQuery, rdfModel); - long graphSize = determineBestCandidateQueryExecution.execConstruct().size(); - if(graphSize > bestNumRelations) - { - bestNumRelations = graphSize; - bestCandidateId = entry.getKey(); - bestCandidateClass = entry.getValue(); - } - - determineBestCandidateQueryExecution.close(); - - } - logger.debug("The RDF graph contains multiple objects which can be parsed to " + targetClass.getSimpleName() + ". Determined " + bestCandidateId + " as best candidate."); - return (T) handleObject(rdfModel, bestCandidateId, bestCandidateClass); - } - - //We only reach this spot, if there is exactly one return candidate. Let's return it - Map.Entry> singularEntry = returnCandidates.entrySet().iterator().next(); - return (T) handleObject(rdfModel, singularEntry.getKey(), singularEntry.getValue()); - - } - - - /** - * Entry point to this class. Takes a message and a desired target class (can be an interface) - * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(String message, Class targetClass) throws IOException { - Model model = readMessage(message); - return parseMessage(model, targetClass); - } - - /** - * Entry point to this class. Takes a message and a desired target class (can be an interface) - * @param message Object to be parsed. Note that the name is misleading: One can also parse non-message IDS objects with this function - * @param targetClass Desired target class (something as abstract as "Message.class" is allowed) - * @param serializationFormat Input RDF format - * @param Desired target class - * @return Object of desired target class, representing the values contained in input message - * @throws IOException if the parsing of the message fails - */ - T parseMessage(String message, Class targetClass, Lang serializationFormat) throws IOException { - Model model = readMessage(message, serializationFormat); - return parseMessage(model, targetClass); - } - - /** - * Reads a message into an Apache Jena model, guessing the input language. - * Note: Guessing the language may cause some error messages during parsing attempts - * - * @param message Message to be read - * @return The model of the message - */ - private Model readMessage(String message) throws IOException { - - List supportedLanguages = new ArrayList<>( - Arrays.asList( - RDFLanguages.JSONLD, //JSON-LD first - RDFLanguages.TURTLE, //N-TRIPLE is a subset of Turtle - RDFLanguages.RDFXML - )); - - for (Lang lang : supportedLanguages) { - try { - return readMessage(message, lang); - } catch (IOException ignored) { - } - } - throw new IOException("Could not parse string as any supported RDF format (JSON-LD, Turtle/N-Triple, RDF-XML)."); - } - - /** - * Reads a message into an Apache Jena model, guessing the input language. - * Note: Guessing the language may cause some error messages during parsing attempts - * - * @param message Message to be read - * @param language The RDF serialization of the input. Supported formats are JSON-LD, N-Triple, Turtle, and RDF-XML - * @return The model of the message - */ - private Model readMessage(String message, Lang language) throws IOException { - - Model targetModel = ModelFactory.createDefaultModel(); - - try { - RDFDataMgr.read(targetModel, new ByteArrayInputStream(message.getBytes()), language); - } - catch (RiotException e) - { - throw new IOException("Failed to parse input as " + language, e); - } - return targetModel; - } - - /** - * Get a list of all subclasses (by JsonSubTypes annotation) which can be instantiated - * @param someClass Input class of which implementable subclasses need to be found - * @return ArrayList of instantiable subclasses - */ - ArrayList> getImplementingClasses(Class someClass) { - ArrayList> result = new ArrayList<>(); - KnownSubtypes subTypeAnnotation = someClass.getAnnotation(KnownSubtypes.class); - if (subTypeAnnotation != null) { - KnownSubtypes.Type[] types = subTypeAnnotation.value(); - for (KnownSubtypes.Type type : types) { - result.addAll(getImplementingClasses(type.value())); - } - } - if (!someClass.isInterface() && !Modifier.isAbstract(someClass.getModifiers())) { - result.add(Serializer.customImplementationMap.getOrDefault(someClass, someClass)); - } - return result; - } - - private void addArtificialBlankNodeLabels(Model m) - { - //Get all blank nodes - Query q = QueryFactory.create("SELECT DISTINCT ?s { ?s ?p ?o . FILTER(isBlank(?s)) } "); - QueryExecution qe = QueryExecutionFactory.create(q, m); - ResultSet rs = qe.execSelect(); - List statementsToAdd = new ArrayList<>(); - while(rs.hasNext()) - { - QuerySolution qs = rs.next(); - statementsToAdd.add(ResourceFactory.createStatement(qs.get("?s").asResource(), - ResourceFactory.createProperty(blankNodeIdPropertyUri.toString()), - ResourceFactory.createStringLiteral(qs.get("?s").toString()))); - } - qe.close(); - m.add(statementsToAdd); - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java deleted file mode 100644 index ebdf6c1cc..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.JsonPreprocessor; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing.TypeNamePreprocessor; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom.ReflectiveMixInResolver; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.riot.Lang; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.*; - -public class Serializer implements org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer, Deserializer { - - private static final ObjectMapper mapper = new ObjectMapper(); - private final List preprocessors; - private final Logger logger = LoggerFactory.getLogger(Serializer.class); - - public static String implementingClassesNamePrefix = "Default"; - public static String implementingClassesNameSuffix = ""; - - static Map, Class> customImplementationMap = new HashMap<>(); - - private static boolean charsetWarningPrinted = false; - - public Serializer() { - mapper.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL); - mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); - mapper.setMixInResolver(new ReflectiveMixInResolver()); - - preprocessors = new ArrayList<>(); - this.addPreprocessor(new TypeNamePreprocessor()); - - if(!Charset.defaultCharset().equals(StandardCharsets.UTF_8) && !charsetWarningPrinted) - { - charsetWarningPrinted = true; - logger.warn("Standard Charset is set to " + Charset.defaultCharset() + " - expecting " + StandardCharsets.UTF_8 + ". Some characters might not be displayed correctly.\nThis warning is only printed once"); - } - - //Default namespaces for AAS - addKnownNamespace("xsd", "http://www.w3.org/2001/XMLSchema#"); - addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); - addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); - //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); - - } - - /** - * Serializes an object to an RDF representation. In order to support RDF, the input instance must be - * annotated using AAS Metamodel annotations. Default format is Turtle (TTL). - * - * @param instance the instance to be serialized - * @return RDF serialization of the provided object graph - * @throws IOException if the serialization fails - */ - public String serialize(Object instance) throws IOException { - return serialize(instance, RDFLanguages.TTL, new HashMap<>()); - } - - /** - * Serializes an object to an RDF representation of a given RDF serialization format. In order to support RDF, the - * input instance must be annotated using AAS Metamodel annotations. - * - * @param instance the instance to be serialized - * @param format the RDF format to be returned (only RDFLanguages.TTL, RDFLanguages.JSONLD, RDFLanguages.RDFXML) - * @return RDF serialization of the provided object graph - * @throws IOException if the serialization fails - */ - public synchronized String serialize(Object instance, Lang format) throws IOException { - return serialize(instance, format, new HashMap<>() ); - } - - - //Synchronized is required for thread safety. Without it, context elements might be missing in case of multiple simultaneous calls to this function - public synchronized String serialize(Object instance, Lang format, Map idMap) throws IOException { - if (format != RDFLanguages.JSONLD && format != RDFLanguages.TURTLE && format != RDFLanguages.RDFXML) { - throw new IOException("RDFFormat " + format + " is currently not supported by the serializer."); - } - mapper.registerModule(new JsonLDModule(idMap)); - String jsonLD = (instance instanceof Collection) - ? serializeCollection((Collection) instance) - : mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); - if (format == RDFLanguages.JSONLD) return jsonLD; - else return convertJsonLdToOtherRdfFormat(jsonLD, format); - } - - private String serializeCollection(Collection collection) throws IOException { - String lineSep = System.lineSeparator(); - StringBuilder jsonLDBuilder = new StringBuilder(); - - if (collection.isEmpty()) { - jsonLDBuilder.append("[]"); - } else { - jsonLDBuilder.append("["); - jsonLDBuilder.append(lineSep); - for (Object item : collection) { - jsonLDBuilder.append(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(item)); - jsonLDBuilder.append(","); - jsonLDBuilder.append(lineSep); - } - int lastComma = jsonLDBuilder.lastIndexOf(","); - jsonLDBuilder.replace(lastComma, lastComma + 1, ""); - jsonLDBuilder.append("]"); - } - jsonLDBuilder.append(lineSep); - - return jsonLDBuilder.toString(); - } - - public String convertJsonLdToOtherRdfFormat(String jsonLd, Lang format) { - Model model = ModelFactory.createDefaultModel(); - RDFDataMgr.read(model, new ByteArrayInputStream(jsonLd.getBytes()), RDFLanguages.JSONLD); - - ByteArrayOutputStream os = new ByteArrayOutputStream(); - RDFDataMgr.write(os, model, format); - return os.toString(); - } - - public String serializePlainJson(Object instance) throws JsonProcessingException { - return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(instance); - } - - /** - * Inverse method of "serialize" - * - * @param serialization JSON(-LD) string - * @param valueType class of top level type - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(String serialization, Class valueType) throws DeserializationException { - try { - return new Parser().parseMessage(serialization, valueType); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Inverse method of "serialize" - * - * @param serialization JSON(-LD) string - * @param valueType class of top level type - * @param serializationFormat RDF input format - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(String serialization, Class valueType, Lang serializationFormat) throws DeserializationException { - try { - - return new Parser().parseMessage(serialization, valueType, serializationFormat); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Inverse method of "serialize" - * - * @param rdfModel Input RDF Model to be turned into an Instance of the IDS Java classes - * @param valueType class of top level type - * @param deserialized type - * @return an object representing the provided JSON(-LD) structure - * @throws DeserializationException thrown, if deserialization fails, e.g. because the input is not valid RDF - */ - public T deserialize(Model rdfModel, Class valueType) throws DeserializationException { - try { - return new Parser().parseMessage(rdfModel, valueType); - } - catch (IOException e) - { - throw new DeserializationException("Failed to deserialize input.", e); - } - } - - /** - * Allows to add further known namespaces to the message parser. Allows parsing to Java objects with JsonSubTypes annotations with other prefixes than "ids:". - * @param prefix Prefix to be added - * @param namespaceUrl URL of the prefix - */ - public static void addKnownNamespace(String prefix, String namespaceUrl) - { - Parser.knownNamespaces.put(prefix, namespaceUrl); - JsonLDSerializer.contextItems.put(prefix, namespaceUrl); - } - - /** - * Method to add a preprocessor for deserialization. - *

- * Important note: The preprocessors are executed in the same order they were added. - * - * @param preprocessor the preprocessor to add - */ - public void addPreprocessor(JsonPreprocessor preprocessor) { - preprocessors.add(preprocessor); - } - - /** - * Method to add a preprocessor for deserialization. - *

- * Important note: The preprocessors are executed in the same order they were added. - * - * @param preprocessor the preprocessor to add - * @param validate set whether the preprocessors output should be checked by RDF4j - */ - public void addPreprocessor(JsonPreprocessor preprocessor, boolean validate) { - preprocessor.enableRDFValidation(validate); - addPreprocessor(preprocessor); - } - - /** - * remove a preprocessor if no longer needed - * - * @param preprocessor the preprocessor to remove - */ - public void removePreprocessor(JsonPreprocessor preprocessor) { - preprocessors.remove(preprocessor); - } - - @Override - public String write(Environment aasEnvironment) throws SerializationException { - try { - return serialize(aasEnvironment); - } - catch (IOException e) - { - throw new SerializationException("Failed to serialize environment.", e); - } - } - - public String write(Environment aasEnvironment, Lang format) throws SerializationException { - return write(aasEnvironment, format, new HashMap<>()); - } - - public String write(Environment aasEnvironment, Lang format, Map idMap) throws SerializationException { - try { - return serialize(aasEnvironment, format, idMap); - } - catch (IOException e) - { - throw new SerializationException("Failed to serialize environment.", e); - } - } - @Override - public Environment read(String value) throws DeserializationException { - try { - return new Parser().parseMessage(value, Environment.class); - } - catch (IOException e) - { - throw new DeserializationException("Could not deserialize to environment.", e); - } - } - - public Environment read(String value, Lang serializationFormat) throws DeserializationException { - try { - return new Parser().parseMessage(value, Environment.class, serializationFormat); - } - catch (IOException e) - { - throw new DeserializationException("Could not deserialize to environment.", e); - } - } - - @Override - public void useImplementation(Class aasInterface, Class implementation) { - customImplementationMap.put(aasInterface, implementation); - //throw new NotImplementedException("Custom implementation support not yet implemented"); - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java deleted file mode 100644 index 972b02561..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/UriSerializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import java.io.IOException; -import java.net.URI; - - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonStreamContext; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -public class UriSerializer extends StdSerializer { - - - public UriSerializer() { - this(null); - } - - public UriSerializer(Class clazz) { - super(clazz); - } - - - @Override - public void serialize(URI value, JsonGenerator gen, SerializerProvider provider) throws IOException { - String serializedUri = value.toString(); - // String idPattern = "{\"@id\": \"" + serializedUri + "\"}"; - JsonStreamContext context = gen.getOutputContext(); - if (context.getCurrentName() != null && context.getCurrentName().contains("@id")) { - gen.writeString(serializedUri); - } else { - gen.writeStartObject(); - gen.writeStringField("@id", serializedUri); - gen.writeEndObject(); - } - } - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java deleted file mode 100644 index d2e04c6db..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/BigDecimalSerializer.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import java.io.IOException; -import java.math.BigDecimal; - -public class BigDecimalSerializer extends StdSerializer { - - public BigDecimalSerializer() { - this(null); - } - - public BigDecimalSerializer(Class clazz) { - super(clazz); - } - - @Override - public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider provider) throws IOException { - gen.writeStartObject(); - gen.writeStringField("@value", value.toString()); - gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#decimal"); - gen.writeEndObject(); - } -} \ No newline at end of file diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java deleted file mode 100644 index 47ff2ec1d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/JsonLdEnumMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.JsonLdEnumSerializer; - -@JsonSerialize(using = JsonLdEnumSerializer.class) -public class JsonLdEnumMixin { -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java deleted file mode 100644 index c60d62dc9..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/LangStringMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - - -import java.util.List; - -@JsonTypeName("rdf:langString") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface LangStringMixin { - @JsonProperty("@value") - public String getValue(); - - @JsonProperty("@language") - public String getLanguage(); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java deleted file mode 100644 index e7eb1a61c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/ReflectiveMixInResolver.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.databind.introspect.ClassIntrospector; - -public class ReflectiveMixInResolver implements ClassIntrospector.MixInResolver { - - @Override - public Class findMixInClassFor(Class cls) { - if (cls.isEnum()) - { - return JsonLdEnumMixin.class; - } - try { - return Class.forName("org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins." + cls.getSimpleName() + "Mixin"); - } - catch (ClassNotFoundException ignored) - { - return null; - } - } - - @Override - public ClassIntrospector.MixInResolver copy() { - return new ReflectiveMixInResolver(); - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java deleted file mode 100644 index 94c0f9d08..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarDeserializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.IOException; -import java.time.ZonedDateTime; -import java.util.GregorianCalendar; - -public class XMLGregorianCalendarDeserializer extends StdDeserializer { - - public XMLGregorianCalendarDeserializer() { - this(XMLGregorianCalendar.class); - } - - public XMLGregorianCalendarDeserializer(Class clazz) { - super(clazz); - } - - @Override - public XMLGregorianCalendar deserialize(JsonParser p, DeserializationContext context) throws IOException { - XMLGregorianCalendar xgc = null; - try { - xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(GregorianCalendar.from(ZonedDateTime.parse(p.getValueAsString()))); - } catch (DatatypeConfigurationException e) { - e.printStackTrace(); - } - return xgc; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java deleted file mode 100644 index a4cfb571c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/custom/XMLGregorianCalendarSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.custom; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -import javax.xml.datatype.XMLGregorianCalendar; -import java.io.IOException; -import java.text.SimpleDateFormat; - -public class XMLGregorianCalendarSerializer extends StdSerializer { - - public XMLGregorianCalendarSerializer() { - this(null); - } - - public XMLGregorianCalendarSerializer(Class clazz) { - super(clazz); - } - - @Override - public void serialize(XMLGregorianCalendar value, JsonGenerator gen, SerializerProvider provider) throws IOException { - SimpleDateFormat xsdDateTimeStampFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"); - xsdDateTimeStampFormat.setCalendar(value.toGregorianCalendar()); - String xsdDateTimeStampFormatted = xsdDateTimeStampFormat.format(value.toGregorianCalendar().getTime()); - gen.writeStartObject(); - gen.writeStringField("@value", xsdDateTimeStampFormatted); - gen.writeStringField("@type", "http://www.w3.org/2001/XMLSchema#dateTimeStamp"); - gen.writeEndObject(); - - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java deleted file mode 100644 index f3b92a6e0..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AdministrativeInformationMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:AdministrativeInformation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AdministrativeInformationMixin extends HasDataSpecificationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - String getVersion(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - void setVersion(String version); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") - String getRevision(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") - void setRevision(String revision); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java deleted file mode 100644 index 44edbc177..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AnnotatedRelationshipElementMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -@JsonTypeName("aas:AnnotatedRelationshipElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AnnotatedRelationshipElementMixin extends RelationshipElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") - List getAnnotations(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotation") - void setAnnotations(List annotations); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java deleted file mode 100644 index 306463292..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetAdministrationShellMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:AssetAdministrationShell") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AssetAdministrationShellMixin extends HasDataSpecificationMixin, IdentifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - void setAssetInformation(AssetInformation assetInformation); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - void setDerivedFrom(Reference derivedFrom); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") - List getSubmodels(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel") - void setSubmodels(List submodels); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java deleted file mode 100644 index 45f2afe13..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/AssetInformationMixin.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:AssetInformation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface AssetInformationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") - AssetKind getAssetKind(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") - void setAssetKind(AssetKind assetKind); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - Reference getGlobalAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - void setGlobalAssetId(Reference globalAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") - List getSpecificAssetIds(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") - void setSpecificAssetIds(List specificAssetIds); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") - List getBillOfMaterials(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/billOfMaterial") - void setBillOfMaterials(List billOfMaterials); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - File getDefaultThumbnail(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - void setDefaultThumbnail(File defaultThumbnail); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java deleted file mode 100644 index 2690318f6..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BasicEventElementMixin.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -@JsonTypeName("aas:BasicEventElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface BasicEventElementMixin extends EventElementMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") - Direction getDirection(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") - void setDirection(Direction direction); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - String getLastUpdate(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - void setLastUpdate(String lastUpdate); - - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - String getMaxInterval(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - void setMaxInterval(String maxInterval); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") - Reference getMessageBroker(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") - void setMessageBroker(Reference messageBroker); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - String getMessageTopic(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - void setMessageTopic(String messageTopic); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") - String getMinInterval(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") - void setMinInterval(String minInterval); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - Reference getObserved(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - void setObserved(Reference observed); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - StateOfEvent getState(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - void setState(StateOfEvent state); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java deleted file mode 100644 index dfb2e7a6d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/BlobMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Blob") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface BlobMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - void setConentType(String mimeType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") - byte[] getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Blob/value") - void setValue(byte[] value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java deleted file mode 100644 index 1991a410d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/CapabilityMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Capability") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface CapabilityMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java deleted file mode 100644 index 196244ecd..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ConceptDescriptionMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:ConceptDescription") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ConceptDescriptionMixin extends HasDataSpecificationMixin, IdentifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") - List getIsCaseOf(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") - void setIsCaseOf(List isCaseOf); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java deleted file mode 100644 index abc0d5f1d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataElementMixin.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -@JsonTypeName("aas:DataElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = File.class), - @JsonSubTypes.Type(value = Blob.class), - @JsonSubTypes.Type(value = MultiLanguageProperty.class), - @JsonSubTypes.Type(value = Property.class), - @JsonSubTypes.Type(value = Range.class), - @JsonSubTypes.Type(value = ReferenceElement.class) -}) -public interface DataElementMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java deleted file mode 100644 index ecef45ebc..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - -@JsonTypeName("aas:DataSpecificationContent") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) -}) -public interface DataSpecificationContentMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java deleted file mode 100644 index 13c3b6aec..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - -@JsonTypeName("aas:DataSpecificationIEC61360") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public DataTypeIEC61360 getDataType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public void setDataType(DataTypeIEC61360 dataType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") - public List getDefinition(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") - public void setDefinitions(List definition); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") - public LevelType getLevelType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") - public void setLevelType(LevelType levelType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") - public List getPreferredName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") - public void setPreferredName(List preferredName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") - public List getShortName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") - public void setShortName(List shortName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") - public String getSourceOfDefinition(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") - public void setSourceOfDefinition(String sourceOfDefinition); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") - public String getSymbol(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") - public void setSymbol(String symbol); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") - public String getUnit(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") - public void setUnit(String unit); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") - public Reference getUnitId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") - public void setUnitId(Reference unitId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") - public String getValueFormat(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") - public void setValueFormat(String valueFormat); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") - public String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") - public void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") - public ValueList getValueList(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") - public void setValueList(ValueList valueList); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") - public Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java deleted file mode 100644 index 8caf8a712..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationPhysicalUnitMixin.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - -@JsonTypeName("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationPhysicalUnitMixin { - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - String getConversionFactor(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - void setConversionFactor(String conversionFactor); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") - List getDefinitions(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/definition") - void setDefinitions(List definitions); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - String getDinNotation(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - void setDinNotation(String dinNotation); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - String getEceCode(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - void setEceCode(String eceCode); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - String getEceName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - void setEceName(String eceName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - String getNistName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - void setNistName(String nistName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") - String getSiName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siName") - void setSiName(String siName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - String getSiNotation(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - void setSiNotation(String siNotation); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - String getRegistrationAuthorityId(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - void setRegistrationAuthorityId(String registrationAuthorityId); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - String getSupplier(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - void setSupplier(String supplier); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - String getUnitName(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - void setUnitName(String unitName); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - String getUnitSymbol(); - - @JsonProperty("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - void setUnitSymbol(String unitSymbol); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java deleted file mode 100644 index af4615037..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:EmbeddedDataSpecification") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EmbeddedDataSpecificationMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public DataSpecificationIEC61360 getDataSpecificationContent(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") - public Reference getDataSpecification(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") - public void setDataSpecification(Reference dataSpecification); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java deleted file mode 100644 index c99abc22d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EntityMixin.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Entity") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EntityMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - Reference getGlobalAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - void setGlobalAssetId(Reference globalAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - SpecificAssetId getSpecificAssetId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - void setSpecificAssetId(SpecificAssetId specificAssetId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") - EntityType getEntityType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") - void setEntityType(EntityType entityType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") - List getStatements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Entity/statement") - void setStatements(List statements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java deleted file mode 100644 index d11186246..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EnvironmentMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -import java.util.List; - -@JsonTypeName("aas:Environment") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EnvironmentMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") - List getAssetAdministrationShells(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") - void setAssetAdministrationShells(List assetAdministrationShells); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - List getConceptDescriptions(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - void setConceptDescriptions(List conceptDescriptions); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - List getSubmodels(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - void setSubmodels(List submodels); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java deleted file mode 100644 index 242a382b8..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventElementMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; - - -@JsonTypeName("aas:EventElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = BasicEventElement.class) -}) -public interface EventElementMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java deleted file mode 100644 index cf749d68b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EventMessageMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:EventMessage") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface EventMessageMixin extends SubmodelElementMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java deleted file mode 100644 index 49d8ef044..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ExtensionMixin.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Extension") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ExtensionMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") - String getName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/name") - void setName(String name); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - Reference getRefersTo(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - void setRefersTo(Reference refersTo); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java deleted file mode 100644 index b3d153445..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FileMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:File") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface FileMixin extends DataElementMixin, SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/contentType") - void setContentType(String contentType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/File/value") - void setValue(String value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java deleted file mode 100644 index a8005ea52..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/FormulaMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:Formula") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface FormulaMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") - List getDependsOns(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Formula/dependsOn") - void setDependsOns(List dependsOns); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java deleted file mode 100644 index 9663339aa..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasDataSpecificationMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -import java.util.List; - -@JsonTypeName("aas:HasDataSpecification") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = AdministrativeInformation.class), - @JsonSubTypes.Type(value = AssetAdministrationShell.class), - @JsonSubTypes.Type(value = ConceptDescription.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface HasDataSpecificationMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") - List getDataSpecifications(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiations") - void setDataSpecifications(List dataSpecifications); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") - List getEmbeddedDataSpecifications(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") - void setEmbeddedDataSpecifications(List embeddedDataSpecifications); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java deleted file mode 100644 index 734ee4bbf..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasExtensionsMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; - -import java.util.List; - -@JsonTypeName("aas:HasExtensions") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface HasExtensionsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") - List getExtensions(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension") - void setExtensions(List extensions); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java deleted file mode 100644 index 23a5c6a05..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasKindMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -@JsonTypeName("aas:HasKind") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface HasKindMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - ModelingKind getKind(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - void setKind(ModelingKind kind); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java deleted file mode 100644 index 588ad4c8e..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/HasSemanticsMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - -import java.util.List; - - -@JsonTypeName("aas:HasSemantics") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SpecificAssetId.class), - @JsonSubTypes.Type(value = SubmodelElement.class), - @JsonSubTypes.Type(value = Qualifier.class), - @JsonSubTypes.Type(value = Extension.class) -}) -public interface HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") - Reference getSemanticId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") - void setSemanticId(Reference semanticId); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") - List getSupplementalSemanticIds(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") - void setSupplementalSemanticIds(List references); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java deleted file mode 100644 index 4e165f986..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifiableMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -@JsonTypeName("aas:Identifiable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = AssetAdministrationShell.class), - @JsonSubTypes.Type(value = ConceptDescription.class) -}) -public interface IdentifiableMixin extends ReferableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") - AdministrativeInformation getAdministration(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") - void setAdministration(AdministrativeInformation administration); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") - String getId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") - void setId(String id); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java deleted file mode 100644 index 7c7f55f2a..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierKeyValuePairMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:IdentifierKeyValuePair") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface IdentifierKeyValuePairMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") - String getKey(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/key") - void setKey(String key); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") - Reference getExternalSubjectId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/IdentifierKeyValuePair/externalSubjectId") - void setExternalSubjectId(Reference externalSubjectId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java deleted file mode 100644 index 1416e89a7..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/IdentifierMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Identifier") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface IdentifierMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") - String getIdentifier(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Identifier/identifier") - void setIdentifier(String identifier); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java deleted file mode 100644 index 1d1c5c763..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/KeyMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; - -@JsonTypeName("aas:Key") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface KeyMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") - KeyTypes getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/type") - void setType(KeyTypes type); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Key/value") - void setValue(String value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java deleted file mode 100644 index 562facc00..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/MultiLanguagePropertyMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:MultiLanguageProperty") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface MultiLanguagePropertyMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - List getValues(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - void setValues(List values); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java deleted file mode 100644 index 95e005f22..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ObjectAttributesMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:ObjectAttributes") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ObjectAttributesMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") - List getObjectAttributes(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ObjectAttributes/objectAttribute") - void setObjectAttributes(List objectAttributes); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java deleted file mode 100644 index 3ad6ca03d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.util.List; - -@JsonTypeName("aas:Operation") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface OperationMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") - List getInputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariable") - void setInputVariables(List inputVariables); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") - List getInoutputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariable") - void setInoutputVariables(List inoutputVariables); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") - List getOutputVariables(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariable") - void setOutputVariables(List outputVariables); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java deleted file mode 100644 index 76e45277b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/OperationVariableMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -@JsonTypeName("aas:OperationVariable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface OperationVariableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") - SubmodelElement getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") - void setValue(SubmodelElement value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java deleted file mode 100644 index fade7f4e7..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyDecisionPointMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:PolicyDecisionPoint") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyDecisionPointMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") - boolean getExternalPolicyDecisionPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyDecisionPoint/externalPolicyDecisionPoints") - void setExternalPolicyDecisionPoints(boolean externalPolicyDecisionPoints); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java deleted file mode 100644 index 331c8a872..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyEnforcementPointsMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:PolicyEnforcementPoints") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyEnforcementPointsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") - boolean getExternalPolicyEnforcementPoint(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyEnforcementPoints/externalPolicyEnforcementPoint") - void setExternalPolicyEnforcementPoint(boolean externalPolicyEnforcementPoint); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java deleted file mode 100644 index 817bb2f5c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PolicyInformationPointsMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:PolicyInformationPoints") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PolicyInformationPointsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") - boolean getExternalInformationPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/externalInformationPoints") - void setExternalInformationPoints(boolean externalInformationPoints); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") - List getInternalInformationPoints(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/PolicyInformationPoints/internalInformationPoint") - void setInternalInformationPoints(List internalInformationPoints); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java deleted file mode 100644 index 7658c2e2c..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/PropertyMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Property") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface PropertyMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Property/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java deleted file mode 100644 index 739dfc67f..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifiableMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - -import java.util.List; - -@JsonTypeName("aas:Qualifiable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Submodel.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface QualifiableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") - List getQualifiers(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier") - void setQualifiers(List qualifiers); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java deleted file mode 100644 index 899cbe893..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/QualifierMixin.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:Qualifier") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface QualifierMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") - String getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") - void setType(String type); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java deleted file mode 100644 index fb38aafc5..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RangeMixin.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -@JsonTypeName("aas:Range") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface RangeMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - String getValueType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - void setValueType(String valueType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") - String getMax(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/max") - void setMax(String max); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") - String getMin(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Range/min") - void setMin(String min); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java deleted file mode 100644 index c31908a5d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferableMixin.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Referable") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Identifiable.class), - @JsonSubTypes.Type(value = SubmodelElement.class) -}) -public interface ReferableMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") - String getCategory(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/category") - void setCategory(String category); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/description") - void setDescription(List description); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - List getDisplayName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - void setDisplayName(List displayName); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - String getIdShort(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - void setIdShort(String idShort); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java deleted file mode 100644 index 0a4cb3668..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceElementMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:ReferenceElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ReferenceElementMixin extends DataElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") - Reference getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") - void setValue(Reference value); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java deleted file mode 100644 index bd836cf9d..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ReferenceMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.util.List; - -@JsonTypeName("aas:Reference") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ReferenceMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - List getKeys(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - void setKeys(List keys); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") - ReferenceTypes getType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Reference/type") - void setType(ReferenceTypes type); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java deleted file mode 100644 index d523598ab..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/RelationshipElementMixin.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:RelationshipElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = AnnotatedRelationshipElement.class) -}) -public interface RelationshipElementMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") - Reference getFirst(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") - void setFirst(Reference first); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") - Reference getSecond(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") - void setSecond(Reference second); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java deleted file mode 100644 index 6f535d8a2..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ResourceMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; - -import java.util.List; - -@JsonTypeName("aas:Resource") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ResourceMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - String getContentType(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - void setContentType(String contentType); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") - String getPath(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Resource/path") - void setPath(String path); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java deleted file mode 100644 index 940f36639..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SpecificAssetIdMixin.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -@JsonTypeName("aas:SpecificAssetId") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SpecificAssetIdMixin extends HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") - String getName(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") - void setName(String name); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - Reference getExternalSubjectId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - void setExternalSubjectId(Reference reference); - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java deleted file mode 100644 index 6ee1af3b6..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubjectAttributesMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -@JsonTypeName("aas:SubjectAttributes") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubjectAttributesMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") - List getSubjectAttributes(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubjectAttributes/subjectAttribute") - void setSubjectAttributes(List subjectAttributes); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java deleted file mode 100644 index f9559be87..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementCollectionMixin.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; - -@JsonTypeName("aas:SubmodelElementCollection") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelElementCollectionMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") - boolean getAllowDuplicates(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/allowDuplicates") - void setAllowDuplicates(boolean allowDuplicates); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") - boolean getOrdered(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/ordered") - void setOrdered(boolean ordered); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - Collection getValues(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - void setValues(Collection values); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java deleted file mode 100644 index 2b754f2c1..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementListMixin.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.util.List; - -@JsonTypeName("aas:SubmodelElementList") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelElementListMixin extends SubmodelElementMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") - boolean getOrderRelevant(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") - void setOrderRelevant(boolean orderRelevant); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") - Reference getSemanticIdListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") - void setSemanticIdListElement(Reference semanticIdListElement); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") - AasSubmodelElements getTypeValueListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") - void setTypeValueListElement(AasSubmodelElements typeValueListElement); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - List getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - void setValue(List value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java deleted file mode 100644 index f8f878da4..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelElementMixin.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - -@JsonTypeName("aas:SubmodelElement") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = RelationshipElement.class), - @JsonSubTypes.Type(value = DataElement.class), - @JsonSubTypes.Type(value = File.class), - @JsonSubTypes.Type(value = Capability.class), - @JsonSubTypes.Type(value = Entity.class), - @JsonSubTypes.Type(value = EventElement.class), - @JsonSubTypes.Type(value = EventPayload.class), - @JsonSubTypes.Type(value = Operation.class), - @JsonSubTypes.Type(value = SubmodelElementCollection.class) -}) -public interface SubmodelElementMixin extends ReferableMixin, QualifiableMixin, HasDataSpecificationMixin, HasKindMixin, HasSemanticsMixin { - -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java deleted file mode 100644 index a5dcc9a8b..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/SubmodelMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.List; - -@JsonTypeName("aas:Submodel") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface SubmodelMixin extends QualifiableMixin, HasDataSpecificationMixin, IdentifiableMixin, HasKindMixin, HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") - List getSubmodelElements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement") - void setSubmodelElements(List submodelElements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java deleted file mode 100644 index 5d7ac5811..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueListMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; - -import java.util.List; - - -@JsonTypeName("aas:ValueList") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ValueListMixin { - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") - List getValueReferencePairs(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") - void setValueReferencePairs(List valueReferencePairs); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java deleted file mode 100644 index fc75ff057..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ValueReferencePairMixin.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -@JsonTypeName("aas:ValueReferencePair") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ValueReferencePairMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") - String getValue(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") - void setValue(String value); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") - Reference getValueId(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") - void setValueId(Reference valueId); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java deleted file mode 100644 index dcae112eb..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/ViewMixin.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -@JsonTypeName("aas:View") -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface ViewMixin extends ReferableMixin, HasDataSpecificationMixin, HasSemanticsMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") - List getContainedElements(); - - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/View/containedElement") - void setContainedElements(List containedElements); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java deleted file mode 100644 index 209b9e98f..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/BasePreprocessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.jena.riot.RDFLanguages; - - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -/** - * basic implementation of {@code JsonPreprocessor} that encapsulates validation. - * By default, validation is disabled for performance reasons (@context has to be downloaded each time). - */ -public abstract class BasePreprocessor implements JsonPreprocessor { - - private boolean validate = false; - - - @Override - public final String preprocess(String input) throws IOException { - String result = preprocess_impl(input); - if(validate) { - Model m = ModelFactory.createDefaultModel(); - RDFDataMgr.read(m, new ByteArrayInputStream(result.getBytes()), RDFLanguages.JSONLD); - } - return result; - } - - abstract String preprocess_impl(String input) throws IOException; - - @Override - public void enableRDFValidation(boolean validate) { - this.validate = validate; - } -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java deleted file mode 100644 index eb99ac8b3..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/JsonPreprocessor.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - -import java.io.IOException; - -/** - * Interface for JSON-LD preprocessors which should transform JSON-LD inputs - * before they are deserialized by Jackson. - * - * Implementations used at the same time must not interfere with each other. - */ -public interface JsonPreprocessor { - - /** - * preprocessing method - * @param input of the transformation, the original JSON-LD - * @return the transformation´s result - * @throws IOException if preprocessing fails, e.g. because the input is not valid RDF - */ - public String preprocess(String input) throws IOException; - - /** - * specify wheter the transformation's result should be validated to - * be parsable by RDF4j - * @param validate enable/disable switch - */ - public void enableRDFValidation(boolean validate); -} diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java deleted file mode 100644 index e117d0359..000000000 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/preprocessing/TypeNamePreprocessor.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf.preprocessing; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -public class TypeNamePreprocessor extends BasePreprocessor { - - private static final Map prefixes; - - static { - prefixes = new HashMap<>(); - prefixes.put("ids:", "https://w3id.org/idsa/core/"); - prefixes.put("idsc:", "https://w3id.org/idsa/code/"); - prefixes.put("info:", "http://www.fraunhofer.de/fraunhofer-digital/infomodell#"); - prefixes.put("kdsf:", "http://kerndatensatz-forschung.de/version1/technisches_datenmodell/owl/Basis#"); - } - - @Override - String preprocess_impl(String input) throws IOException { - ObjectMapper mapper = new ObjectMapper(); - Map inMap = mapper.readValue(input, Map.class); - Map outMap = unifyTypeURIPrefix(inMap); - return mapper.writeValueAsString(outMap); - } - - - private Map unifyTypeURIPrefix(Map in) { - Map out = new LinkedHashMap<>(); - in.forEach((k,v) -> { - if(v instanceof String && k instanceof String && k.equals("@type")) { - - - // if key is @type and value is a string: add 'ids:' if no other namespace at the value - AtomicReference modifiableValue = new AtomicReference<>((String) v); - prefixes.forEach((p, u) -> modifiableValue.set(modifiableValue.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableValue.get().startsWith("ids:") - || modifiableValue.get().startsWith("idsc:") - || modifiableValue.get().startsWith("info:") - || modifiableValue.get().startsWith("kdsf:") - || modifiableValue.get().startsWith("xsd:") - || modifiableValue.get().startsWith("http://") - || modifiableValue.get().startsWith("https://"))) { - modifiableValue.set("ids:".concat(modifiableValue.get())); // default to ids prefix for backwards compatibility - } - out.put(k, modifiableValue.get()); - - - } else if(v instanceof Map) { - AtomicReference modifiableKey = new AtomicReference<>((String) k); - - prefixes.forEach((prefix, uri) -> modifiableKey.set(modifiableKey.get().replace(uri, prefix))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://") - || modifiableKey.get().startsWith("@context"))) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - - - // shorten an @id Map - if (((Map) v).containsKey("@id") && ((Map) v).keySet().size() == 1) { - Map idMap = new LinkedHashMap<>(); - idMap.put(k, ((Map) v).get("@id")); - - out.putAll(unifyTypeURIPrefix(idMap)); - - } else if (((Map) v).containsKey("@value") && - ((Map) v).containsKey("@type")) - { - if( ((Map) v).get("@type").toString().contains("dateTime") ) - { - - // shorten an @value Map with xsd:dateTimes - Object date = ((Map) v).get("@value"); - out.put(modifiableKey, date); - } - else if(((Map) v).get("@type").toString().equals("xsd:integer")) - { - int value = Integer.parseInt(((Map) v).get("@value").toString()); - out.put(modifiableKey, value); - } - else { //Do the same as below - out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); - } - - } else { - - out.put(modifiableKey, unifyTypeURIPrefix((Map) v)); - - - } - - } else if(v instanceof ArrayList) { - - - AtomicReference modifiableKey = new AtomicReference<>((String) k); - prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://"))) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - - Iterator iter = new ArrayList((ArrayList) v).iterator(); //making a copy of the old array so the iterator does not get confused by the element deletions - while (iter.hasNext()) { - Object child = iter.next(); - if (child instanceof Map && ((Map) child).containsKey("@id") && ((Map) child).keySet().size() == 1) { - ((ArrayList) v).remove(child); - ((ArrayList) v).add(((Map) child).get("@id")); - } - } - - out.put(modifiableKey, unifyTypeURIPrefix((ArrayList) v)); // TODO: What happens with an Array inside the Array? - - - } else { - - - AtomicReference modifiableKey = new AtomicReference<>((String) k); - prefixes.forEach((p, u) -> modifiableKey.set(modifiableKey.get().replace(u, p))); // replace full URI with prefix - if(! (modifiableKey.get().startsWith("ids:") - || modifiableKey.get().startsWith("info:") - || modifiableKey.get().startsWith("kdsf:") - || modifiableKey.get().startsWith("http://") - || modifiableKey.get().startsWith("https://") - || modifiableKey.get().startsWith("@"))) { - //in the context definition, a pair might look like this: "ids" : "http://www.someURL.com" - //Here, we start with "ids", not "ids:". So we also need to check that the key is not contained in our prefixes - if(!prefixes.containsKey(modifiableKey.get() + ":")) { - modifiableKey.set("ids:".concat(modifiableKey.get())); // default to ids prefix for backwards compatibility - } - } - - out.put(modifiableKey, v); // modify nothing if not @type or a map - } - }); - return out; - } - - - private ArrayList unifyTypeURIPrefix(ArrayList in) { - ArrayList out = new ArrayList<>(); - - Iterator iter = in.iterator(); - - while (iter.hasNext()) { - Object v = iter.next(); - if(v instanceof Map) { - - - if (!((Map) v).isEmpty()) - out.add( unifyTypeURIPrefix((Map) v)); - - - } else if (v instanceof String) { - - out.add(v); // modify nothing if not @type or a map - } else { - out.add(v); - } - } - return out; - } - - - - -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java deleted file mode 100644 index 8d603f749..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; - -import org.apache.jena.riot.RDFLanguages; - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; - -import junitparams.JUnitParamsRunner; -import junitparams.Parameters; - -import java.io.IOException; - -@RunWith(JUnitParamsRunner.class) -public class ParserTest { - - @Test - public void parseAasEnvironmentTest() throws IOException, DeserializationException { - String aasEnvAsString = SerializerUtil.readResourceToString("example-from-serializer.jsonld"); - Environment aasEnv = new Serializer().read(aasEnvAsString); - Assert.assertEquals(1, aasEnv.getSubmodels().size()); - Assert.assertEquals(1, aasEnv.getAssetAdministrationShells().get(0).getDescription().size()); - Assert.assertEquals(2, aasEnv.getAssetAdministrationShells().get(0).getDisplayName().size()); - - Assert.assertEquals("de", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(0).getLanguage()); - Assert.assertEquals("en", aasEnv.getAssetAdministrationShells().get(0).getDisplayName().get(1).getLanguage()); - Assert.assertNotNull(aasEnv.getAssetAdministrationShells().get(0).getDescription().get(0).getLanguage()); - - } - - @Test - @Ignore - public void parseFullTurtleEnvironmentTest() throws IOException, DeserializationException { - String aasEnvAsString = SerializerUtil.readResourceToString("AASFull.ttl"); - Environment environment = new Serializer().read(aasEnvAsString); - - // TODO continue providing a correct AASFull Turtle representation - // TODO test for LangStrings - Assert.assertEquals(AASFull.ENVIRONMENT, environment); - } - - - @Test - @Parameters({"AAS_Reference_shortExample.ttl", "AssetAdministrationShell_Example.ttl", - "Complete_Example.ttl", "ReferenceExample.ttl" /*, "KapitalVerwaltungsschaleExample.ttl"*/}) - public void parseAasTurtleSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - - AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file),AssetAdministrationShell.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); - } - - @Test - @Parameters({ "AAS_Reference_shortExample.nt", "Overall-Example.nt"}) - public void parseAasNtriplesSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - - AssetAdministrationShell aas = serializer.deserialize(SerializerUtil.readResourceToString(file), AssetAdministrationShell.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(aas.getAssetInformation().getAssetKind()); - } - - @Test - @Parameters({"Submodel_SubmodelElement_Example.ttl"}) - public void parseSubmodelSchemaExamplesTest(String file) throws IOException, DeserializationException { - Serializer serializer = new Serializer(); - //These work - - Submodel submodel = serializer.deserialize(SerializerUtil.readResourceToString(file), Submodel.class, RDFLanguages.TURTLE); - - Assert.assertNotNull(submodel.getSubmodelElements().get(0).getIdShort()); - - - //The following examples do not work yet, as they are semantically problematic - //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.ttl"), Reference.class, RDFLanguages.TURTLE); - //serializer.deserialize(SerializerUtil.readResourceToString("Submodel_SubmodelElement_shortExample.nt"), Reference.class, RDFLanguages.NTRIPLES); - } - - - - - @Test - public void deserializeConceptDescription() throws IOException, DeserializationException { - String conceptDescription = "{\n" + - " \"@context\" : {\n" + - " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + - " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + - " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + - " },\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + - " \"@type\" : \"aas:ConceptDescription\",\n" + - " \"isCaseOf\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications\" : [ {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecification/f461858c-8981-4141-bac3-6aee56977017\",\n" + - " \"@type\" : \"aas:EmbeddedDataSpecification\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultReference/41ee5bcc-adde-4a5a-bfb5-ace237247d0c\",\n" + - " \"@type\" : \"aas:Reference\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/Reference/key\" : [ {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultKey/234b457f-0e8f-46b3-8e73-f850a79269f1\",\n" + - " \"@type\" : \"aas:Key\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/Key/value\" : \"https://example.org\"\n" + - " } ]\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + - " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + - " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + - " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + - " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + - " } ]\n" + - "}"; - - Serializer serializer = new Serializer(); - ConceptDescription c = serializer.deserialize(conceptDescription, ConceptDescription.class); - - Assert.assertNotNull(c); - } - - -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java deleted file mode 100644 index 2d7d56c03..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.apache.jena.riot.RDFLanguages; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; - -import org.junit.Assert; -import org.junit.Test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class SerializerTest { - - //TODO: Optional: Prefixes instead of full URIs - //TODO: Optional: Do not serialize empty collections - - @Test - public void serializeEnvironment() throws IOException, DeserializationException { - - AssetAdministrationShell aas = new DefaultAssetAdministrationShell.Builder() - .assetInformation(new DefaultAssetInformation.Builder() - .assetKind(AssetKind.INSTANCE) - .build()) - .description(Arrays.asList(new DefaultLangString.Builder().text("This is a test AAS").language("en-us").build())) - .displayName(Arrays.asList( - new DefaultLangString.Builder().text("Anzeigename 2").language("de").build(), - new DefaultLangString.Builder().text("Display Name 1").language("en").build() - )) - .build(); - - Submodel submodel = new DefaultSubmodel.Builder() - .description(Arrays.asList(new DefaultLangString.Builder().text("My Submodel").language("en-us").build())) - .displayName(Arrays.asList( - new DefaultLangString.Builder().text("First Submodel Element name").language("en").build(), - new DefaultLangString.Builder().text("Second Submodel Element name").language("en").build() - )) - .category("Example category") - .build(); - - ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .value("https://example.org") - .build()) - .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.RATIONAL) - .build()) - .build()) - .build(); - - List aasList = new ArrayList<>(Collections.singletonList(aas)); - Environment aasEnv = new DefaultEnvironment.Builder() - .assetAdministrationShells(aasList) - .submodels(submodel) - .conceptDescriptions(conceptDescription) - .build(); - - String output = new Serializer().serialize(aasEnv, RDFLanguages.JSONLD); - //System.out.println(output); - - Assert.assertTrue(output.contains("@context")); - // Assert.assertTrue(output.contains("rdf:")); // TODO: why should the output contain the 'rdf' prefix? - Assert.assertTrue(output.contains("\"@type\" : \"aas:Environment\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:AssetAdministrationShell\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:Submodel\"")); - Assert.assertTrue(output.contains("\"@type\" : \"aas:ConceptDescription\"")); - - Environment environment = new Serializer().deserialize(output, Environment.class); - Assert.assertNotNull(environment); - - // Assert.assertTrue(aasEnv.equals(environment)); // TODO: Serialising and parsing to/from RDF looses the sequence of e.g. LangStrings, therefore this test fails also for semantically equal objects - } -} diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java deleted file mode 100644 index b738b7278..000000000 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerUtil.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.rdf; - - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; - -import org.apache.commons.io.IOUtils; - -/** - * Helper class for Serializer Tests - * - * @author sbader - * - */ -public class SerializerUtil { - - public static String readResourceToString(String resourceName) throws IOException { - ClassLoader classloader = Thread.currentThread().getContextClassLoader(); - InputStream is = classloader.getResourceAsStream(resourceName); - StringWriter writer = new StringWriter(); - IOUtils.copy(is, writer, "UTF-8"); - return writer.toString(); - } - - public static String stripWhitespaces(String input) { - return input.replaceAll("\\s+", ""); - } - -} diff --git a/dataformat-rdf/src/test/resources/AASFull.ttl b/dataformat-rdf/src/test/resources/AASFull.ttl deleted file mode 100644 index 8c11c4546..000000000 --- a/dataformat-rdf/src/test/resources/AASFull.ttl +++ /dev/null @@ -1,354 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - -# AAS Environment - rdf:type aas:Environment ; - ; - ; - ; -. - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "MaxRotationSpeed"^^xs:string ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "PARAMETER"^^xs:string ; - "0173-1#02-BAA120#008"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Max. rotation speed"@en, "max. Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; - . - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "RotationSpeed"^^xs:string ; - rdfs:label "RotationSpeed"^^xs:string ; - "PROPERTY"^^xs:string ; - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] . - - rdf:type aas:DataSpecificationIEC61360 ; - "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Document"^^xs:string ; - rdfs:label "Document"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Document"@en, "Dokument"@de ; - "Document"@en ; - "[ISO 15519-1:2010]"^^xs:string ; - ; - "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Title"^^xs:string ; - rdfs:label "Title"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; - . - - rdf:type aas:DataSpecificationIEC61360 ; - "Titel"@en, "Titel"@de ; - "Titel"@en ; - ; - "Sprachabhängiger Titel des Dokuments."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "DigitalFile"^^xs:string ; - rdfs:label "DigitalFile"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - - rdf:type aas:DataSpecificationIEC61360 ; - "Digital File"@en ; - "DigitalFile"@en ; - ; - "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt deleted file mode 100644 index 65b752bdc..000000000 --- a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.nt +++ /dev/null @@ -1,16 +0,0 @@ - . - "ExampleMotor"^^ . - "ExampleMotor"^^ . - "A very short description of the AAS instance"@en . - "A very short description of the AAS instance."^^ . - "https://customer.com/aas/9175_7013_7091_9168"^^ . - _:AssetInformation . -_:AssetInformation . -_:AssetInformation _:GlobalAssetId . -_:AssetInformation . -_:GlobalAssetId . -_:GlobalAssetId . -_:GlobalAssetId _:Key . -_:Key . -_:Key . -_:Key "https://customer.com/assets/KHBVZJSQKIY"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl b/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl deleted file mode 100644 index e22b250fd..000000000 --- a/dataformat-rdf/src/test/resources/AAS_Reference_shortExample.ttl +++ /dev/null @@ -1,27 +0,0 @@ -@prefix : . -@prefix aas: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; -. diff --git a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl b/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl deleted file mode 100644 index e5f25bfe6..000000000 --- a/dataformat-rdf/src/test/resources/AssetAdministrationShell_Example.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Complete_Example.ttl b/dataformat-rdf/src/test/resources/Complete_Example.ttl deleted file mode 100644 index 0c800f8d1..000000000 --- a/dataformat-rdf/src/test/resources/Complete_Example.ttl +++ /dev/null @@ -1,347 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - -# Asset Administration Shell - rdf:type aas:AssetAdministrationShell ; - "ExampleMotor"^^xs:string ; - rdfs:label "ExampleMotor"^^xs:string ; - "A very short description of the AAS instance"@en ; - rdfs:comment "A very short description of the AAS instance."^^xs:string ; - "https://customer.com/aas/9175_7013_7091_9168"^^xs:string ; - [ - rdf:type ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] ; - ] ; - ; - ]; - - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ] - ]; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^xs:string ; - ] - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "MaxRotationSpeed"^^xs:string ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "PARAMETER"^^xs:string ; - "0173-1#02-BAA120#008"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Max. rotation speed"@en, "max. Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de, "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en ; - . - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "RotationSpeed"^^xs:string ; - rdfs:label "RotationSpeed"^^xs:string ; - "PROPERTY"^^xs:string ; - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] . - - rdf:type aas:DataSpecificationIEC61360 ; - "Actual rotation speed"@en, "Aktuelle Drehzahl"@de ; - "1/min"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#05-AAA650#002"^^xs:string ; - ] ; - ] ; - ; - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de, "Actual rotation speed with which the motor or feeding unit is operated."@en ; -. - - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Document"^^xs:string ; - rdfs:label "Document"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - rdf:type aas:DataSpecificationIEC61360 ; - "Document"@en, "Dokument"@de ; - "Document"@en ; - "[ISO 15519-1:2010]"^^xs:string ; - ; - "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "Title"^^xs:string ; - rdfs:label "Title"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; - . - - rdf:type aas:DataSpecificationIEC61360 ; - "Titel"@en, "Titel"@de ; - "Titel"@en ; - ; - "Sprachabhängiger Titel des Dokuments."@de ; -. - -# ConceptDescription - rdf:type aas:ConceptDescription ; - "DigitalFile"^^xs:string ; - rdfs:label "DigitalFile"^^xs:string ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^xs:string ; - [ - rdf:type aas:EmbeddedDataSpecification ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^xs:string ; - ] ; - ] ; - ; - ] ; -. - - - rdf:type aas:DataSpecificationIEC61360 ; - "Digital File"@en ; - "DigitalFile"@en ; - ; - "Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden."@de ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Overall-Example.nt b/dataformat-rdf/src/test/resources/Overall-Example.nt deleted file mode 100644 index 3921c9aff..000000000 --- a/dataformat-rdf/src/test/resources/Overall-Example.nt +++ /dev/null @@ -1,253 +0,0 @@ - . - "ExampleMotor"^^ . - "ExampleMotor"^^ . - "A very short description of the AAS instance"@en . - "A very short description of the AAS instance."^^ . - "https://customer.com/aas/9175_7013_7091_9168"^^ . - _:AssetInformation . - _:Submodel1 . - _:Submodel2 . - _:Submodel3 . -_:AssetInformation . -_:AssetInformation _:GlobalAssetId1 . -_:AssetInformation . -_:GlobalAssetId1 . -_:GlobalAssetId1 . -_:GlobalAssetId1 _:Key1 . -_:Key1 . -_:Key1 . -_:Key1 "https://customer.com/assets/KHBVZJSQKIY"^^ . -_:Submodel1 . -_:Submodel1 . -_:Submodel1 _:Key2 . -_:Key2 . -_:Key2 . -_:Key2 "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . -_:Submodel2 . -_:Submodel2 . -_:Submodel2 _:Key3 . -_:Key3 . -_:Key3 . -_:Key3 "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . -_:Submodel3 . -_:Submodel3 . -_:Submodel3 _:Key4 . -_:Key4 . -_:Key4 . -_:Key4 "http://i40.customer.com/type/1/1/1A7B62B529F19152"^^ . - . - "TechnicalData"^^ . - "TechnicalData"^^ . - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . - . - _:SemanticId1 . - _:SubmodelElement1 . -_:SemanticId1 . -_:SemanticId1 . -_:SemanticId1 _:Key5 . -_:Key5 . -_:Key5 . -_:Key5 "0173-1#01-AFZ615#016"^^ . -_:SubmodelElement1 . -_:SubmodelElement1 "MaxRotationSpeed"^^ . -_:SubmodelElement1 "MaxRotationSpeed"^^ . -_:SubmodelElement1 . -_:SubmodelElement1 _:ValueId1 . -_:SubmodelElement1 "5000"^^ . -_:ValueId1 . -_:ValueId1 . -_:ValueId1 _:Key6 . -_:Key6 . -_:Key6 . -_:Key6 "0173-1#02-BAA120#008"^^ . - . - "OperationalData"^^ . - "OperationalData"^^ . - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^ . - . - _:SubmodelElement2 . -_:SubmodelElement2 . -_:SubmodelElement2 "RotationSpeed"^^ . -_:SubmodelElement2 "RotationSpeed"^^ . -_:SubmodelElement2 . -_:SubmodelElement2 . -_:SubmodelElement2 _:ValueId2 . -_:SubmodelElement2 "4370"^^ . -_:ValueId2 . -_:ValueId2 . -_:ValueId2 _:Key7 . -_:Key7 . -_:Key7 . -_:Key7 "http://customer.com/cd/1/1/18EBD56F6B43D895"^^ . - . - "Documentation"^^ . - "Documentation"^^ . - " . - . - _:SubmodelElement3 . -_:SubmodelElement3 . -_:SubmodelElement3 "OperatingManual"^^ . -_:SubmodelElement3 "OperatingManual"^^ . -_:SubmodelElement3 _:SemanticIdListElement1 . -_:SubmodelElement3 . -_:SubmodelElement3 _:Value1 . -_:SubmodelElement3 _:Value3 . -_:SubmodelElement3 . -_:SemanticIdListElement1 . -_:SemanticIdListElement1 . -_:SemanticIdListElement1 _:Key8 . -_:Key8 . -_:Key8 . -_:Key8 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . -_:Value1 . -_:Value1 _:Value2 . -_:Value2 . -_:Value2 . -_:Value2 "Title"^^ . -_:Value2 "application/pdf" . -_:Value2 "file:///aas/OperatingManual.pdf"^^ . -_:Value2 "Title"^^ . -_:Value2 "CONSTANT"^^ . -_:Value2 _:SemanticId2 . -_:Value2 . -_:SemanticId2 . -_:SemanticId2 . -_:SemanticId2 _:Key9 . -_:Key9 . -_:Key9 . -_:Key9 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . -_:Value3 . -_:Value3 _:Value4 . -_:Value4 . -_:Value4 . -_:Value4 "DigitalFile_PDF"^^ . -_:Value4 "application/pdf" . -_:Value4 "file:///aasx/OperatingManual.pdf"^^ . -_:Value4 "DigitalFile_PDF"^^ . -_:Value4 "CONSTANT"^^ . -_:Value4 _:SemanticId3. -_:Value4 . -_:SemanticId3 . -_:SemanticId3 . -_:SemanticId3 _:Key10 . -_:Key10 . -_:Key10 . -_:Key10 "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^ . - . - "MaxRotationSpeed"^^ . - "MaxRotationSpeed"^^ . - "PARAMETER"^^ . - "0173-1#02-BAA120#008"^^ . - _:EmbeddedDataSpecification1 . -_:EmbeddedDataSpecification1 . -_:EmbeddedDataSpecification1 _:DataSpecification1 . -_:EmbeddedDataSpecification1 . -_:DataSpecification1 . -_:DataSpecification1 . -_:DataSpecification1 _:Key11 . -_:Key11 . -_:Key11 . -_:Key11 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Max. rotation speed"@en . - "max. Drehzahl"@de . - "1/min"^^ . - _:UnitId1 . - . - "H\u00F6chste zul\u00E4ssige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf"@de . - "Greatest permissible rotation speed with which the motor or feeding unit may be operated"@en . -_:UnitId1 . -_:UnitId1 . -_:UnitId1 _:Key12 . -_:Key12 . -_:Key12 . -_:Key12 "0173-1#05-AAA650#002"^^ . - . - "RotationSpeed"^^ . - "RotationSpeed"^^ . - "PROPERTY"^^ . - "https://customer.com/cd/18EBD56F6B43D895/RotationSpeed"^^ . - _:EmbeddedDataSpecification2 . -_:EmbeddedDataSpecification2 . -_:EmbeddedDataSpecification2 _:DataSpecification2 . -_:EmbeddedDataSpecification2 . -_:DataSpecification2 . -_:DataSpecification2 . -_:DataSpecification2 _:Key13 . -_:Key13 . -_:Key13 . -_:Key13 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Actual rotation speed"@en . - "Aktuelle Drehzahl"@de . - "1/min"^^ . - _:UnitId2 . - . - "Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird."@de . - "Actual rotation speed with which the motor or feeding unit is operated."@en . -_:UnitId2 . -_:UnitId2 . -_:UnitId2 _:Key14 . -_:Key14 . -_:Key14 . -_:Key14 "0173-1#05-AAA650#002"^^ . - . - "Document"^^ . - "Document"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^ . - _:EmbeddedDataSpecification3 . -_:EmbeddedDataSpecification3 . -_:EmbeddedDataSpecification3 _:DataSpecification3 . -_:EmbeddedDataSpecification3 . -_:DataSpecification3 . -_:DataSpecification3 . -_:DataSpecification3 _:Key15 . -_:Key15 . -_:Key15 . -_:Key15 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Document"@en . - "Dokument"@de . - "Document"@en . - "[ISO 15519-1:2010]"^^ . - . - "Feste und geordnete Menge von f\u00FCr die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann."@de . - . - "Title"^^ . - "Title"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^ . - _:EmbeddedDataSpecification4 . -_:EmbeddedDataSpecification4 . -_:EmbeddedDataSpecification4 _:DataSpecification4 . -_:EmbeddedDataSpecification4 . -_:DataSpecification4 . -_:DataSpecification4 . -_:DataSpecification4 _:Key16 . -_:Key16 . -_:Key16 . -_:Key16 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Titel"@en . - "Titel"@de . - "Titel"@en . - . - "Sprachabh\u00E4ngiger Titel des Dokuments."@de . - . - "DigitalFile"^^ . - "DigitalFile"^^ . - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile"^^ . - _:EmbeddedDataSpecification5 . -_:EmbeddedDataSpecification5 . -_:EmbeddedDataSpecification5 _:DataSpecification5 . -_:EmbeddedDataSpecification5 . -_:DataSpecification5 . -_:DataSpecification5 . -_:DataSpecification5 _:Key17 . -_:Key17 . -_:Key17 . -_:Key17 "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"^^ . - . - "Digital File"@en . - "DigitalFile"@en . - . - "Eine Datei, die die DocumentVersion repr\u00E4sentiert. Neben der obligatorischen PDF/A Datei k\u00F6nnen weitere Dateien angegeben werden."@de . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/ReferenceExample.ttl b/dataformat-rdf/src/test/resources/ReferenceExample.ttl deleted file mode 100644 index a18db83e5..000000000 --- a/dataformat-rdf/src/test/resources/ReferenceExample.ttl +++ /dev/null @@ -1,18 +0,0 @@ -@prefix xs: . - -# 1) Reference with KeyElements - a ; - [ - a ; - ; - [ - a ; - ; - [ - a ; - ; - "http://customer.com/assets/KHBVZJSQKIY"^^xs:string ; - ] - ] - ] ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl deleted file mode 100644 index 3e50807d6..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_Example.ttl +++ /dev/null @@ -1,137 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "OperationalData"^^xs:string ; - rdfs:label "OperationalData"^^xs:string ; - "http://i40.customer.com/instance/1/1/AC69B1CB44F07935"^^xs:string ; - ; - - [ - rdf:type aas:Property ; - rdfs:label "RotationSpeed"^^xs:string ; - "RotationSpeed"^^xs:string ; - ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "http://customer.com/cd/1/1/18EBD56F6B43D895"^^xs:string ; - ] - - ]; - "4370"^^xs:string ; - ]; -. - -# Submodel - rdf:type aas:Submodel ; - "Documentation"^^xs:string ; - rdfs:label "Documentation"^^xs:string ; - " ; - [ - rdf:type aas:SubmodelElementList ; - "OperatingManual"^^xs:string ; - rdfs:label "OperatingManual"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document"^^xs:string ; - ] - ] ; - ; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type ; - rdf:subject ; - rdfs:label "Title"^^xs:string ; - "application/pdf" ; - "file:///aas/OperatingManual.pdf"^^xs:string ; # TODO - "Title"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title"^^xs:string ; - ] - ] ; - ; - ] - ]; - [ - rdf:type aas:SubmodelElementCollection ; - [ - rdf:type aas:File; - rdf:subject ; - rdfs:label "DigitalFile_PDF"^^xs:string ; - "application/pdf" ; - "file:///aasx/OperatingManual.pdf"^^xs:string ; - "DigitalFile_PDF"^^xs:string ; - "CONSTANT"^^xs:string ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "https://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/escription/Title"^^xs:string ; - ] - ] ; - ; - ]; - ] ; - ; - ] ; -. \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt deleted file mode 100644 index 2733f1131..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.nt +++ /dev/null @@ -1,25 +0,0 @@ - . - "TechnicalData"^^ . - "TechnicalData"^^ . - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^ . - . - _:SemanticId . - _:SubmodelElements . -_:SemanticId . -_:SemanticId . -_:SemanticId _:Key1 . -_:Key1 . -_:Key1 . -_:Key1 "0173-1#01-AFZ615#016"^^ . -_:SubmodelElements . -_:SubmodelElements "MaxRotationSpeed"^^ . -_:SubmodelElements "MaxRotationSpeed"^^ . -_:SubmodelElements . -_:SubmodelElements _:ValueId . -_:SubmodelElements "5000"^^ . -_:ValueId . -_:ValueId . -_:ValueId _:Key2 . -_:Key2 . -_:Key2 . -_:Key2 "0173-1#02-BAA120#008"^^ . \ No newline at end of file diff --git a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl b/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl deleted file mode 100644 index 9c1d7f8c4..000000000 --- a/dataformat-rdf/src/test/resources/Submodel_SubmodelElement_shortExample.ttl +++ /dev/null @@ -1,42 +0,0 @@ -@prefix aas: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix xs: . - - - -# Submodel - rdf:type aas:Submodel ; - "TechnicalData"^^xs:string ; - rdfs:label "TechnicalData"^^xs:string ; - "http://i40.customer.com/type/1/1/7A7104BDAB57E184"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#01-AFZ615#016"^^xs:string ; - ] ; - ] ; - - - [ - rdf:type aas:Property ; - rdfs:label "MaxRotationSpeed"^^xs:string ; - "MaxRotationSpeed"^^xs:string ; - ; - [ - rdf:type aas:Reference ; - ; - [ - rdf:type aas:Key ; - ; - "0173-1#02-BAA120#008"^^xs:string ; - ] ; - ]; - "5000"^^xs:string ; - ]; -. diff --git a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld b/dataformat-rdf/src/test/resources/example-from-serializer.jsonld deleted file mode 100644 index 7eac7fa6c..000000000 --- a/dataformat-rdf/src/test/resources/example-from-serializer.jsonld +++ /dev/null @@ -1,88 +0,0 @@ -{ - "@context" : { - "aas" : "https://admin-shell.io/aas/3/0/RC02/" - }, - "@id" : "https://admin-shell.io/autogen/DefaultEnvironment/7e646a58-7419-41e2-99e8-163a7abb7b46", - "@type" : "aas:Environment", - "https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultAssetAdministrationShell/b869a629-8d69-4754-9c50-804b0e9eb35a", - "@type" : "aas:AssetAdministrationShell", - "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation" : { - "@id" : "https://admin-shell.io/autogen/DefaultAssetInformation/6882a093-6831-445d-a884-f2ebc37aaa29", - "@type" : "aas:AssetInformation", - "https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind" : { - "@type" : "aas:AssetKind", - "@id" : "https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance" - }, - "https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds" : [ ] - }, - "https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodel" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { - "@language" : "en-us", - "@value" : "This is a test AAS" - } ], - "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { - "@language" : "de", - "@value" : "Anzeigename 2" - }, { - "@language" : "en", - "@value" : "Display Name 1" - } ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] - } ], - "https://admin-shell.io/aas/3/0/RC02/Environment/conceptdescriptions" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultConceptDescription/14b4a819-7ca0-4cb2-b2c7-33a1c443c899", - "@type" : "aas:ConceptDescription", - "https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultDataSpecification/66cf9a6c-e656-4c95-91be-2ddc1779ec71", - "@type" : "aas:EmbeddedDataSpecification", - "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecifiation" : { - "@id" : "https://admin-shell.io/autogen/DefaultReference/251d9f19-b36b-4c39-b517-3d7e93bd8c96", - "@type" : "aas:Reference", - "https://admin-shell.io/aas/3/0/RC02/Reference/key" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultKey/ad4e8527-e002-4776-87ca-7049e7be440f", - "@type" : "aas:Key", - "https://admin-shell.io/aas/3/0/RC02/Key/value" : "https://example.org" - } ] - } , - "https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent" : { - "@id" : "https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/5319d62e-7ca1-4954-addf-76db6bf1e241", - "@type" : "aas:DataSpecificationIEC61360", - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType" : { - "@type" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/DataTypeIEC61360", - "@id" : "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/RATIONAL" - }, - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition" : [ ], - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName" : [ ], - "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName" : [ ] - }, - "https://admin-shell.io/aas/3/0/RC02/DataSpecification/id" : "http://example.org/DataSpecification1" - } ] - } ], - "https://admin-shell.io/aas/3/0/RC02/Environment/submodels" : [ { - "@id" : "https://admin-shell.io/autogen/DefaultSubmodel/18810336-c309-42f8-9986-438f7068f0d6", - "@type" : "aas:Submodel", - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/dataSpecifiation" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasExtensions/extension" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifier" : [ ], - "https://admin-shell.io/aas/3/0/RC02/Referable/category" : "Example category", - "https://admin-shell.io/aas/3/0/RC02/Referable/description" : [ { - "@language" : "en-us", - "@value" : "My Submodel" - } ], - "https://admin-shell.io/aas/3/0/RC02/Referable/displayName" : [ { - "@language" : "en", - "@value" : "First Submodel Element name" - }, { - "@language" : "en", - "@value" : "Second Submodel Element name" - } ], - "https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElement" : [ ], - "https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications" : [ ] - } ] -} \ No newline at end of file From a30a902fb7ff154ea230eccf1e26378635b3c22c Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 15:02:29 +0200 Subject: [PATCH 13/91] fix compile errors --- .../core/DataSpecificationManager.java | 4 +- ...ministrationShellElementWalkerVisitor.java | 14 +- .../core/serialization/EnumSerializer.java | 4 +- ...ssetAdministrationShellElementVisitor.java | 4 +- ...ministrationShellElementWalkerVisitor.java | 10 +- .../aas4j/v3/dataformat/core/AASFull.java | 487 ++++++++---------- .../aas4j/v3/dataformat/core/AASSimple.java | 66 ++- .../v3/dataformat/core/CustomProperty.java | 21 +- .../dataformat/core/EnumDeserializerTest.java | 32 +- .../dataformat/core/EnumSerializerTest.java | 32 +- .../json/mixins/ConceptDescriptionMixin.java | 2 +- .../DataSpecificationIec61360Mixin.java | 2 +- .../json/JsonReferenceDeserializerTest.java | 6 +- .../v3/dataformat/json/TestDataHelper.java | 18 +- .../v3/dataformat/rdf/JsonLDSerializer.java | 2 +- .../aas4j/v3/dataformat/rdf/Serializer.java | 2 +- .../mixins/DataSpecificationContentMixin.java | 2 +- .../DataSpecificationIEC61360Mixin.java | 60 +-- .../EmbeddedDataSpecificationMixin.java | 6 +- .../aas4j/v3/dataformat/rdf/ParserTest.java | 16 +- .../v3/dataformat/rdf/SerializerTest.java | 6 +- ...mbeddedDataSpecificationsDeserializer.java | 12 +- .../DataSpecificationIec61360Mixin.java | 6 +- .../EmbeddedDataSpecificationMixin.java | 2 +- .../xml/mixins/HasSemanticsMixin.java | 2 +- .../dataformat/xml/mixins/PropertyMixin.java | 2 +- .../xml/mixins/SpecificAssetIDMixin.java | 2 +- .../xml/mixins/SubmodelElementListMixin.java | 2 +- .../EmbeddedDataSpecificationSerializer.java | 10 +- .../LangStringsNameTypeSerializer.java | 2 +- .../AssetAdministrationShellDescriptor.java | 8 +- .../aas4j/v3/model/AssetInformation.java | 4 +- .../v3/model/DataSpecificationContent.java | 2 +- .../v3/model/DataSpecificationIec61360.java | 84 +-- .../aas4j/v3/model/DataTypeIec61360.java | 42 +- .../digitaltwin/aas4j/v3/model/Entity.java | 4 +- .../digitaltwin/aas4j/v3/model/LevelType.java | 46 +- .../aas4j/v3/model/MultiLanguageProperty.java | 4 +- .../digitaltwin/aas4j/v3/model/Referable.java | 8 +- .../aas4j/v3/model/ReferenceTypes.java | 4 +- .../aas4j/v3/model/SubmodelDescriptor.java | 8 +- .../AnnotatedRelationshipElementBuilder.java | 4 +- .../AssetAdministrationShellBuilder.java | 8 +- ...tAdministrationShellDescriptorBuilder.java | 4 +- .../builder/AssetInformationBuilder.java | 2 +- .../builder/BasicEventElementBuilder.java | 8 +- .../aas4j/v3/model/builder/BlobBuilder.java | 8 +- .../v3/model/builder/CapabilityBuilder.java | 8 +- .../builder/ConceptDescriptionBuilder.java | 8 +- .../DataSpecificationIec61360Builder.java | 4 +- .../aas4j/v3/model/builder/EntityBuilder.java | 10 +- .../aas4j/v3/model/builder/FileBuilder.java | 8 +- .../builder/MultiLanguagePropertyBuilder.java | 12 +- .../v3/model/builder/OperationBuilder.java | 8 +- .../v3/model/builder/PropertyBuilder.java | 8 +- .../aas4j/v3/model/builder/RangeBuilder.java | 8 +- .../builder/ReferenceElementBuilder.java | 8 +- .../builder/RelationshipElementBuilder.java | 8 +- .../v3/model/builder/SubmodelBuilder.java | 8 +- .../builder/SubmodelDescriptorBuilder.java | 7 +- .../SubmodelElementCollectionBuilder.java | 8 +- .../builder/SubmodelElementListBuilder.java | 8 +- .../DefaultAnnotatedRelationshipElement.java | 12 +- .../impl/DefaultAssetAdministrationShell.java | 12 +- ...ultAssetAdministrationShellDescriptor.java | 12 +- .../model/impl/DefaultAssetInformation.java | 6 +- .../model/impl/DefaultBasicEventElement.java | 12 +- .../aas4j/v3/model/impl/DefaultBlob.java | 12 +- .../v3/model/impl/DefaultCapability.java | 12 +- .../model/impl/DefaultConceptDescription.java | 12 +- .../DefaultDataSpecificationIec61360.java | 50 +- .../aas4j/v3/model/impl/DefaultEntity.java | 18 +- .../aas4j/v3/model/impl/DefaultFile.java | 12 +- .../impl/DefaultMultiLanguageProperty.java | 18 +- .../aas4j/v3/model/impl/DefaultOperation.java | 12 +- .../aas4j/v3/model/impl/DefaultProperty.java | 12 +- .../aas4j/v3/model/impl/DefaultRange.java | 12 +- .../model/impl/DefaultReferenceElement.java | 12 +- .../impl/DefaultRelationshipElement.java | 12 +- .../aas4j/v3/model/impl/DefaultSubmodel.java | 12 +- .../model/impl/DefaultSubmodelDescriptor.java | 15 +- .../DefaultSubmodelElementCollection.java | 12 +- .../impl/DefaultSubmodelElementList.java | 12 +- .../v3/model/validator/TestAASc_006.java | 16 +- .../v3/model/validator/TestAASc_008.java | 10 +- .../v3/model/validator/TestAASd_067.java | 12 +- .../v3/model/validator/TestAASd_068.java | 16 +- .../v3/model/validator/TestAASd_069.java | 12 +- .../v3/model/validator/TestAASd_076.java | 8 +- .../v3/model/validator/TestAASd_65a.java | 24 +- .../v3/model/validator/TestAASd_66a.java | 10 +- 91 files changed, 792 insertions(+), 820 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java index 0db3ae12a..e1a214c87 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -39,11 +39,11 @@ public class DataSpecificationManager { public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; - public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0"; + public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0"; public static final String DATA_SPECIFICATION_IEC61360_PREFIX = "IEC"; private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( - // new DataSpecificationInfo(DataSpecificationIEC61360.class, + // new DataSpecificationInfo(DataSpecificationIec61360.class, // createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), // DATA_SPECIFICATION_IEC61360_PREFIX) )); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index f8229333e..90110b82c 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -72,7 +72,7 @@ public default void visit(ConceptDescription conceptDescription) { if (conceptDescription == null) { return; } - conceptDescription.getIsCaseOfs().forEach(x -> visit(x)); + conceptDescription.getIsCaseOf().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(conceptDescription); } @@ -127,7 +127,7 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValues().forEach(x -> visit(x)); + multiLanguageProperty.getValue().forEach(x -> visit(x)); visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -173,8 +173,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescriptions().forEach(x -> visit(x)); - referable.getDisplayNames().forEach(x -> visit(x)); + referable.getDescription().forEach(x -> visit(x)); + referable.getDisplayName().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -243,7 +243,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - entity.getSpecificAssetIds().forEach(x -> visit(x)); + visit(entity.getSpecificAssetId()); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -253,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - extension.getRefersTos().forEach(x -> visit(x)); + visit(extension.getRefersTo()); AssetAdministrationShellElementVisitor.super.visit(extension); } @@ -282,7 +282,7 @@ public default void visit(SubmodelElementCollection submodelElementCollection) { if (submodelElementCollection == null) { return; } - submodelElementCollection.getValues().forEach(x -> visit(x)); + submodelElementCollection.getValue().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index c0f3631a5..a3583d770 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -24,7 +24,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -50,7 +50,7 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider String enum_string = AasUtils.serializeEnumName(value.name()); gen.writeString("xs:" + enum_string.substring(0, 1).toLowerCase() + enum_string.substring(1)); } - } else if (value instanceof DataTypeIEC61360 || value instanceof Direction || value instanceof StateOfEvent) { + } else if (value instanceof DataTypeIec61360 || value instanceof Direction || value instanceof StateOfEvent) { gen.writeString(value.name()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { gen.writeString(AasUtils.serializeEnumName(value.name())); diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index fc6f2af60..298f531f2 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -49,8 +49,8 @@ public default void visit(DataSpecificationContent dataSpecificationContent) { return; } Class type = dataSpecificationContent.getClass(); - // if (DataSpecificationIEC61360.class.isAssignableFrom(type)) { - // visit((DataSpecificationIEC61360) dataSpecificationContent); + // if (DataSpecificationIec61360.class.isAssignableFrom(type)) { + // visit((DataSpecificationIec61360) dataSpecificationContent); //} } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 9a1e53ad1..e4600c045 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -47,7 +47,7 @@ public default void visit(AssetInformation assetInformation) { if (assetInformation == null) { return; } - visit(assetInformation.getGlobalAssetId()); + //visit(assetInformation.getGlobalAssetId()); assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); visit(assetInformation.getDefaultThumbnail()); AssetAdministrationShellElementVisitor.super.visit(assetInformation); @@ -129,7 +129,7 @@ public default void visit(MultiLanguageProperty multiLanguageProperty) { if (multiLanguageProperty == null) { return; } - multiLanguageProperty.getValue().forEach(x -> visit(x)); + //multiLanguageProperty.getValue().forEach(x -> visit(x)); visit(multiLanguageProperty.getValueId()); AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); } @@ -175,8 +175,8 @@ public default void visit(Referable referable) { if (referable == null) { return; } - referable.getDescription().forEach(x -> visit(x)); - referable.getDisplayName().forEach(x -> visit(x)); + // referable.getDescription().forEach(x -> visit(x)); + // referable.getDisplayName().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(referable); } @@ -213,7 +213,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - visit(entity.getGlobalAssetId()); + //visit(entity.getGlobalAssetId()); visit(entity.getSpecificAssetId()); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index e20d26153..3fa4dc987 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -18,6 +18,7 @@ import java.util.Arrays; import java.util.Base64; +import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; @@ -41,14 +42,14 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_3 = createConceptDescription3(); public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); public static final Environment ENVIRONMENT = createEnvironment(); - public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; + public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() @@ -60,17 +61,11 @@ public static AssetAdministrationShell createAAS1() { .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) .value("https://acplt.org/TestAssetAdministrationShell2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset") //.billOfMaterial((new DefaultReference.Builder() // .keys(new DefaultKey.Builder() // .type(KeyTypes.SUBMODEL) @@ -83,21 +78,21 @@ public static AssetAdministrationShell createAAS1() { .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("http://acplt.org/Submodels/Assets/TestAsset/Identification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -108,27 +103,21 @@ public static AssetAdministrationShell createAAS2() { .id("https://acplt.org/Test_AssetAdministrationShell_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel2_Mandatory") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -139,13 +128,7 @@ public static AssetAdministrationShell createAAS3() { .id("https://acplt.org/Test_AssetAdministrationShell2_Mandatory") .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Mandatory") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Mandatory") .build()) .build(); } @@ -154,8 +137,8 @@ public static AssetAdministrationShell createAAS4() { return new DefaultAssetAdministrationShell.Builder() .idShort("TestAssetAdministrationShell") .description(Arrays.asList( - new DefaultLangString.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An Example Asset Administration Shell for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Verwaltungsschale für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() @@ -164,20 +147,14 @@ public static AssetAdministrationShell createAAS4() { .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset_Missing") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset_Missing") .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) .value("https://acplt.org/Test_Submodel_Missing") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -186,8 +163,8 @@ public static Submodel createSubmodel1() { return new DefaultSubmodel.Builder() .idShort("Identification") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example asset identification submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() @@ -200,13 +177,13 @@ public static Submodel createSubmodel1() { .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/AssetIdentification") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -214,7 +191,7 @@ public static Submodel createSubmodel1() { .value("0173-1#02-AAO677#002") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .value("100") @@ -233,14 +210,14 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ACPLT") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultProperty.Builder() .idShort("InstanceId") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -248,7 +225,7 @@ public static Submodel createSubmodel1() { .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build() ) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) @@ -257,7 +234,7 @@ public static Submodel createSubmodel1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("978-8234-234-342") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build(); @@ -267,8 +244,8 @@ public static Submodel createSubmodel2() { return new DefaultSubmodel.Builder() .idShort("BillOfMaterial") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example bill of material submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung").language("de").build() )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() @@ -280,34 +257,34 @@ public static Submodel createSubmodel2() { .type(KeyTypes.SUBMODEL) .value("http://acplt.org/SubmodelTemplates/BillOfMaterial") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValue2") .valueType(DataTypeDefXsd.STRING) @@ -316,22 +293,22 @@ public static Submodel createSubmodel2() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValue2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .statements(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueType(DataTypeDefXsd.STRING) @@ -340,7 +317,7 @@ public static Submodel createSubmodel2() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .entityType(EntityType.CO_MANAGED_ENTITY) @@ -348,24 +325,18 @@ public static Submodel createSubmodel2() { .submodelElements(new DefaultEntity.Builder() .idShort("ExampleEntity2") .description(Arrays.asList( - new DefaultLangString.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), - new DefaultLangString.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() + new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .entityType(EntityType.SELF_MANAGED_ENTITY) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value("https://acplt.org/Test_Asset2") - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId("https://acplt.org/Test_Asset2") .build()) .build(); } @@ -374,8 +345,8 @@ public static Submodel createSubmodel3() { return new DefaultSubmodel.Builder() .idShort("TestSubmodel") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() @@ -388,21 +359,21 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -439,15 +410,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -492,30 +463,30 @@ public static Submodel createSubmodel3() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -523,7 +494,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -533,15 +504,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -549,7 +520,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -559,15 +530,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleProperty3") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -575,7 +546,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -585,15 +556,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -602,15 +573,15 @@ public static Submodel createSubmodel3() { .direction(Direction.INPUT) .state(StateOfEvent.ON) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -633,30 +604,30 @@ public static Submodel createSubmodel3() { .category("PARAMETER") .orderRelevant(true) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example ExampleSubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel ExampleSubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("http://acplt.org/ValueId/ExampleValueId") .valueId(new DefaultReference.Builder() @@ -664,7 +635,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .valueType(DataTypeDefXsd.STRING) .build()) @@ -672,41 +643,41 @@ public static Submodel createSubmodel3() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleMultiLanguageValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") @@ -717,28 +688,28 @@ public static Submodel createSubmodel3() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -747,15 +718,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -764,15 +735,15 @@ public static Submodel createSubmodel3() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -787,7 +758,7 @@ public static Submodel createSubmodel3() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .build()) @@ -944,8 +915,8 @@ public static Submodel createSubmodel6() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelMissing") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") .kind(ModelingKind.INSTANCE) @@ -957,21 +928,21 @@ public static Submodel createSubmodel6() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1008,15 +979,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1061,30 +1032,30 @@ public static Submodel createSubmodel6() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty1") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1099,15 +1070,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty2") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1122,15 +1093,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleProperty3") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1145,15 +1116,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultBasicEventElement.Builder() @@ -1162,15 +1133,15 @@ public static Submodel createSubmodel6() { .direction(Direction.INPUT) .state(StateOfEvent.ON) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1185,7 +1156,7 @@ public static Submodel createSubmodel6() { .type(KeyTypes.PROPERTY) .value("ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .submodelElements(new DefaultSubmodelElementList.Builder() @@ -1194,29 +1165,29 @@ public static Submodel createSubmodel6() { .orderRelevant(true) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .qualifiers(new DefaultQualifier.Builder() .type("http://acplt.org/Qualifier/ExampleQualifier") @@ -1229,34 +1200,34 @@ public static Submodel createSubmodel6() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .value(Arrays.asList( - new DefaultLangString.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), - new DefaultLangString.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example value of a MultiLanguageProperty element").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispielswert für ein MultiLanguageProperty-Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .min("0") .max("100") @@ -1267,29 +1238,29 @@ public static Submodel createSubmodel6() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .contentType("application/pdf") .value(Base64.getDecoder().decode("AQIDBAU=")) @@ -1298,15 +1269,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value("file:///TestFile.pdf") .contentType("application/pdf") @@ -1315,15 +1286,15 @@ public static Submodel createSubmodel6() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .value(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1349,8 +1320,8 @@ public static Submodel createSubmodel7() { return new DefaultSubmodel.Builder() .idShort("TestSubmodelTemplate") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example submodel for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example submodel for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") .kind(ModelingKind.TEMPLATE) @@ -1363,22 +1334,22 @@ public static Submodel createSubmodel7() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelTemplates/ExampleSubmodel") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example RelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel RelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example RelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel RelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() @@ -1416,15 +1387,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleAnnotatedRelationshipElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example AnnotatedRelationshipElement object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel AnnotatedRelationshipElement Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() @@ -1463,15 +1434,15 @@ public static Submodel createSubmodel7() { .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Operation object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Operation Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Operation Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Operations/ExampleOperation") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() @@ -1479,15 +1450,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1499,15 +1470,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1519,15 +1490,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1539,15 +1510,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleCapability") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Capability object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Capability Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Capability object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Capability Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Capabilities/ExampleCapability") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1557,15 +1528,15 @@ public static Submodel createSubmodel7() { .direction(Direction.OUTPUT) .state(StateOfEvent.OFF) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example BasicEvent object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel BasicEvent Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example BasicEvent object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel BasicEvent Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Events/ExampleBasicEvent") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() @@ -1589,15 +1560,15 @@ public static Submodel createSubmodel7() { .category("PARAMETER") .orderRelevant(true) .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementListOrdered object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementListOrdered Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) @@ -1605,15 +1576,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Property object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Property Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Property object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Property Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Properties/ExampleProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1623,15 +1594,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleMultiLanguageProperty") .category("CONSTANT") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example MultiLanguageProperty object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel MultiLanguageProperty Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE).value( "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1639,15 +1610,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleRange") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .min(null) @@ -1658,15 +1629,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleRange2") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Range object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Range Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Range object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Range Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Ranges/ExampleRange") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .min("0") @@ -1678,30 +1649,30 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementCollection") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Blob object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Blob Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Blob object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Blob Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Blobs/ExampleBlob") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") @@ -1710,15 +1681,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleFile") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example File object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel File Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example File object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel File Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/Files/ExampleFile") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .value(null) @@ -1728,15 +1699,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleReferenceElement") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example Reference Element object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel Reference Element Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example Reference Element object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel Reference Element Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ExampleReferenceElement") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1745,15 +1716,15 @@ public static Submodel createSubmodel7() { .idShort("ExampleSubmodelElementCollection2") .category("PARAMETER") .description(Arrays.asList( - new DefaultLangString.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), - new DefaultLangString.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() + new DefaultLangStringTextType.Builder().text("Example SubmodelElementCollection object").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Beispiel SubmodelElementCollection Element").language("de").build() )) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.TEMPLATE) .build()) @@ -1764,8 +1735,8 @@ public static ConceptDescription createConceptDescription1() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() @@ -1777,7 +1748,7 @@ public static ConceptDescription createConceptDescription1() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -1793,8 +1764,8 @@ public static ConceptDescription createConceptDescription3() { return new DefaultConceptDescription.Builder() .idShort("TestConceptDescription1") .description(Arrays.asList( - new DefaultLangString.Builder().text("An example concept description for the test application").language("en-us").build(), - new DefaultLangString.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() + new DefaultLangStringTextType.Builder().text("An example concept description for the test application").language("en-us").build(), + new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() @@ -1817,22 +1788,22 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(Arrays.asList( new DefaultLangString.Builder().text("Test Specification").language("de").build(), new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() )) - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) @@ -1844,14 +1815,14 @@ public static ConceptDescription createConceptDescription4() { .value("http://acplt.org/Units/SpaceUnit") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") .symbol("SU") .valueFormat("string") .value("TEST") // .levelType(LevelType.MIN) - .levelType(LevelType.MAX) + .levelType(new DefaultLevelType.Builder().max(true).build()) .valueList(new DefaultValueList.Builder() .valueReferencePairs(new DefaultValueReferencePair.Builder() .value("http://acplt.org/ValueId/ExampleValueId") @@ -1860,7 +1831,7 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) // TODO valueType? .build()) @@ -1871,7 +1842,7 @@ public static ConceptDescription createConceptDescription4() { .type(KeyTypes.GLOBAL_REFERENCE) .value("http://acplt.org/ValueId/ExampleValueId2") .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) // TODO valueType? .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index d48733dae..2347000a1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -98,7 +98,7 @@ public class AASSimple { private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY = "VARIABLE"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUE = "4370"; private static final String SUBMODEL_OPERATIONAL_DATA_PROPERTY_VALUETYPE = "integer"; - public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360"; + public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360"; public AASSimple() { } @@ -120,13 +120,7 @@ public static AssetAdministrationShell createAAS() { .id(AAS_IDENTIFIER) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) - .globalAssetId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.ASSET_ADMINISTRATION_SHELL) - .value(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) - .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) - .build()) + .globalAssetId(HTTP_CUSTOMER_COM_ASSETS_KHBVZJSQKIY) .specificAssetIds(new DefaultSpecificAssetId.Builder() .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) @@ -135,7 +129,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .specificAssetIds(new DefaultSpecificAssetId.Builder() @@ -146,7 +140,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_IO_T_1) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) .defaultThumbnail(new DefaultResource.Builder() @@ -159,7 +153,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_TECHNICAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -167,7 +161,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_OPERATIONAL_DATA_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .submodels( new DefaultReference.Builder() @@ -175,7 +169,7 @@ public static AssetAdministrationShell createAAS() { .type(KeyTypes.SUBMODEL) .value(SUBMODEL_DOCUMENTATION_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build(); } @@ -188,7 +182,7 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.GLOBAL_REFERENCE) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .kind(ModelingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) @@ -200,7 +194,7 @@ public static Submodel createSubmodelTechnicalData() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_TECHNICAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_TECHNICAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_TECHNICAL_DATA_PROPERTY_CATEGORY) @@ -222,7 +216,7 @@ public static Submodel createSubmodelOperationalData() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_OPERATIONAL_DATA_SEMANTIC_ID_PROPERTY) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_OPERATIONAL_DATA_PROPERTY_ID_SHORT) .category(SUBMODEL_OPERATIONAL_DATA_PROPERTY_CATEGORY) @@ -244,7 +238,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() @@ -254,7 +248,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_PROPERTY_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_PROPERTY_ID_SHORT) .value(SUBMODEL_DOCUMENTATION_PROPERTY_VALUE) @@ -267,7 +261,7 @@ public static Submodel createSubmodelDocumentation() { .type(KeyTypes.CONCEPT_DESCRIPTION) .value(SUBMODEL_DOCUMENTATION_FILE_SEMANTIC_ID) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .idShort(SUBMODEL_DOCUMENTATION_FILE_ID_SHORT) .contentType(SUBMODEL_DOCUMENTATION_FILE_contentType) @@ -289,16 +283,16 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) + .dataType(DataTypeIec61360.STRING_TRANSLATABLE) .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) @@ -315,17 +309,17 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() + new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.STRING) + .dataType(DataTypeIec61360.STRING) .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) @@ -347,9 +341,9 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) @@ -358,10 +352,10 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) @@ -381,10 +375,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent( - new DefaultDataSpecificationIEC61360.Builder() + new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) @@ -395,10 +389,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .type(KeyTypes.GLOBAL_REFERENCE) .value(_0173_1_05_AAA650_002) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .sourceOfDefinition("ExampleString") - .dataType(DataTypeIEC61360.REAL_MEASURE) + .dataType(DataTypeIec61360.REAL_MEASURE) .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) @@ -416,15 +410,15 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(KeyTypes.GLOBAL_REFERENCE) .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .type(ReferenceTypes.GLOBAL_REFERENCE) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) - .dataType(DataTypeIEC61360.STRING) + .dataType(DataTypeIec61360.STRING) .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index d22adf747..3178bad56 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -16,14 +16,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import java.util.List; import java.util.Objects; @@ -49,9 +42,9 @@ public class CustomProperty implements Property { protected String category; - protected List description; + protected List description; - protected List displayName; + protected List displayName; protected String idShort; @@ -130,12 +123,12 @@ final public void setCategory(String category) { } @Override - final public List getDescription() { + final public List getDescription() { return description; } @Override - final public void setDescription(List description) { + final public void setDescription(List description) { this.description = description; } @@ -150,12 +143,12 @@ public void setChecksum(String checksum) { } @Override - final public List getDisplayName() { + final public List getDisplayName() { return displayName; } @Override - final public void setDisplayName(List displayName) { + final public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index efd6ef3a1..3ad801789 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; @@ -41,21 +41,21 @@ public void setUp() { } @Test - public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertDeserialization("BOOLEAN", DataTypeIEC61360.BOOLEAN); - assertDeserialization("DATE", DataTypeIEC61360.DATE); - assertDeserialization("INTEGER_CURRENCY", DataTypeIEC61360.INTEGER_CURRENCY); - assertDeserialization("INTEGER_COUNT", DataTypeIEC61360.INTEGER_COUNT); - assertDeserialization("INTEGER_MEASURE", DataTypeIEC61360.INTEGER_MEASURE); - assertDeserialization("RATIONAL", DataTypeIEC61360.RATIONAL); - assertDeserialization("RATIONAL_MEASURE", DataTypeIEC61360.RATIONAL_MEASURE); - assertDeserialization("REAL_COUNT", DataTypeIEC61360.REAL_COUNT); - assertDeserialization("REAL_MEASURE", DataTypeIEC61360.REAL_MEASURE); - assertDeserialization("STRING", DataTypeIEC61360.STRING); - assertDeserialization("STRING_TRANSLATABLE", DataTypeIEC61360.STRING_TRANSLATABLE); - assertDeserialization("TIME", DataTypeIEC61360.TIME); - assertDeserialization("TIMESTAMP", DataTypeIEC61360.TIMESTAMP); - assertDeserialization("IRI", DataTypeIEC61360.IRI); + public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); + assertDeserialization("DATE", DataTypeIec61360.DATE); + assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); + assertDeserialization("INTEGER_COUNT", DataTypeIec61360.INTEGER_COUNT); + assertDeserialization("INTEGER_MEASURE", DataTypeIec61360.INTEGER_MEASURE); + assertDeserialization("RATIONAL", DataTypeIec61360.RATIONAL); + assertDeserialization("RATIONAL_MEASURE", DataTypeIec61360.RATIONAL_MEASURE); + assertDeserialization("REAL_COUNT", DataTypeIec61360.REAL_COUNT); + assertDeserialization("REAL_MEASURE", DataTypeIec61360.REAL_MEASURE); + assertDeserialization("STRING", DataTypeIec61360.STRING); + assertDeserialization("STRING_TRANSLATABLE", DataTypeIec61360.STRING_TRANSLATABLE); + assertDeserialization("TIME", DataTypeIec61360.TIME); + assertDeserialization("TIMESTAMP", DataTypeIec61360.TIMESTAMP); + assertDeserialization("IRI", DataTypeIec61360.IRI); } @Test diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 422766102..23ebcab8f 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -51,21 +51,21 @@ public void setUp() throws Exception { } @Test - public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { - assertSerialization(DataTypeIEC61360.BOOLEAN, "BOOLEAN"); - assertSerialization(DataTypeIEC61360.DATE, "DATE"); - assertSerialization(DataTypeIEC61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); - assertSerialization(DataTypeIEC61360.INTEGER_COUNT, "INTEGER_COUNT"); - assertSerialization(DataTypeIEC61360.INTEGER_MEASURE, "INTEGER_MEASURE"); - assertSerialization(DataTypeIEC61360.RATIONAL, "RATIONAL"); - assertSerialization(DataTypeIEC61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); - assertSerialization(DataTypeIEC61360.REAL_COUNT, "REAL_COUNT"); - assertSerialization(DataTypeIEC61360.REAL_MEASURE, "REAL_MEASURE"); - assertSerialization(DataTypeIEC61360.STRING, "STRING"); - assertSerialization(DataTypeIEC61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); - assertSerialization(DataTypeIEC61360.TIME, "TIME"); - assertSerialization(DataTypeIEC61360.TIMESTAMP, "TIMESTAMP"); - assertSerialization(DataTypeIEC61360.IRI, "IRI"); + public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + assertSerialization(DataTypeIec61360.BOOLEAN, "BOOLEAN"); + assertSerialization(DataTypeIec61360.DATE, "DATE"); + assertSerialization(DataTypeIec61360.INTEGER_CURRENCY, "INTEGER_CURRENCY"); + assertSerialization(DataTypeIec61360.INTEGER_COUNT, "INTEGER_COUNT"); + assertSerialization(DataTypeIec61360.INTEGER_MEASURE, "INTEGER_MEASURE"); + assertSerialization(DataTypeIec61360.RATIONAL, "RATIONAL"); + assertSerialization(DataTypeIec61360.RATIONAL_MEASURE, "RATIONAL_MEASURE"); + assertSerialization(DataTypeIec61360.REAL_COUNT, "REAL_COUNT"); + assertSerialization(DataTypeIec61360.REAL_MEASURE, "REAL_MEASURE"); + assertSerialization(DataTypeIec61360.STRING, "STRING"); + assertSerialization(DataTypeIec61360.STRING_TRANSLATABLE, "STRING_TRANSLATABLE"); + assertSerialization(DataTypeIec61360.TIME, "TIME"); + assertSerialization(DataTypeIec61360.TIMESTAMP, "TIMESTAMP"); + assertSerialization(DataTypeIec61360.IRI, "IRI"); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 919c02f51..669c4cc58 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -24,7 +24,7 @@ public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOfs(); + public List getIsCaseOf(); @JsonProperty("isCaseOf") public void setIsCaseOfs(List isCaseOfs); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 67576b8cd..6df15ca74 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -25,7 +25,7 @@ import java.util.List; -public interface DataSpecificationIEC61360Mixin { +public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") public List getLevelTypes(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 9ab226d17..fbcbdda00 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.junit.Before; @@ -46,7 +46,7 @@ public void prepare() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); -// valueReferencePair_string = serializer.write(((DataSpecificationIEC61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); +// valueReferencePair_string = serializer.write(((DataSpecificationIec61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); } @@ -89,7 +89,7 @@ public void testDeserializeReferenceList() throws DeserializationException { List referenceList = deserializer.readReferences(reference_list_string); - assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.GLOBAL_REFERENCE)); + assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 575dfb2da..a6d6d9c3f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -13,12 +13,12 @@ public class TestDataHelper { public static final String DEFAULT_IDENTIFICATION = "identification"; public static final Reference DEFAULT_SEMANTIC_ID = - new DefaultReference.Builder().type(ReferenceTypes.GLOBAL_REFERENCE) + new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) .build(); public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder().build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder().build()) .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = @@ -27,9 +27,9 @@ public class TestDataHelper { .revision("defaultAdministrativeInformationRevisionValue") .version("defaultAdministrativeInformationVersionValue").build(); - public static final List DEFAULT_DESCRIPTION = List.of(createLangString("en", "defaultDescription")); + public static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); - public static final List DEFAULT_DISPLAY_NAME = List.of(createLangString("en", "defaultDisplayName")); + public static final List DEFAULT_DISPLAY_NAME = List.of(createLangStringNameType("en", "defaultDisplayName")); public static final String DEFAULT_ID_SHORT = "defaultIdShort"; @@ -40,12 +40,20 @@ public static LangString createLangString(String langCode, String text) { return new DefaultLangString.Builder().language(langCode).text(text).build(); } + public static LangStringTextType createLangStringTextType(String langCode, String text) { + return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); + } + + public static LangStringNameType createLangStringNameType(String langCode, String text) { + return new DefaultLangStringNameType.Builder().language(langCode).text(text).build(); + } + public static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); } public static Reference createGlobalReference(String value) { - return createReference(ReferenceTypes.GLOBAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + return createReference(ReferenceTypes.EXTERNAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); } public static DefaultEndpoint.Builder createEndpointBuilder() { diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java index d59ef814d..0ce900ea3 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/JsonLDSerializer.java @@ -97,7 +97,7 @@ public void serializeWithType(Object bean, JsonGenerator gen, SerializerProvider private void filterContextWrtBean(Object bean, Map filteredContext) { //Some default entries for AAS filteredContext.put("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //filteredContext.put("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/"); //filteredContext.put("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); if(bean == null || bean.getClass().getName().equals("com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass().getName().equals("org.apache.jena.ext.xerces.jaxp.datatype.XMLGregorianCalendarImpl") || bean.getClass() == BigInteger.class) return; // XMLGregorianCalendarImpl causes infinite recursion diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java index ebdf6c1cc..1a18c39e5 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/Serializer.java @@ -73,7 +73,7 @@ public Serializer() { addKnownNamespace("owl", "http://www.w3.org/2002/07/owl#"); addKnownNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); addKnownNamespace("aas", "https://admin-shell.io/aas/3/0/RC02/"); - //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/"); + //addKnownNamespace("iec61360", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/"); //addKnownNamespace("phys_unit", "https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/"); } diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java index ecef45ebc..a6ef82bef 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationContentMixin.java @@ -27,7 +27,7 @@ @JsonTypeName("aas:DataSpecificationContent") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") @JsonSubTypes({ - @JsonSubTypes.Type(value = DataSpecificationIEC61360.class) + @JsonSubTypes.Type(value = DataSpecificationIec61360.class) }) public interface DataSpecificationContentMixin { diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java index 13c3b6aec..5d50519ea 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/DataSpecificationIEC61360Mixin.java @@ -23,85 +23,85 @@ import java.util.List; -@JsonTypeName("aas:DataSpecificationIEC61360") +@JsonTypeName("aas:DataSpecificationIec61360") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") -public interface DataSpecificationIEC61360Mixin extends DataSpecificationContentMixin { +public interface DataSpecificationIec61360Mixin extends DataSpecificationContentMixin { - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public DataTypeIEC61360 getDataType(); + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + public DataTypeIec61360 getDataType(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - public void setDataType(DataTypeIEC61360 dataType); + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + public void setDataType(DataTypeIec61360 dataType); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") public List getDefinition(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") public void setDefinitions(List definition); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") public LevelType getLevelType(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") public void setLevelType(LevelType levelType); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") public List getPreferredName(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") public void setPreferredName(List preferredName); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") public List getShortName(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") public void setShortName(List shortName); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") public String getSourceOfDefinition(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") public void setSourceOfDefinition(String sourceOfDefinition); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") public String getSymbol(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") public void setSymbol(String symbol); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") public String getUnit(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") public void setUnit(String unit); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") public Reference getUnitId(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") public void setUnitId(Reference unitId); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") public String getValueFormat(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") public void setValueFormat(String valueFormat); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") public String getValue(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") public void setValue(String value); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") public ValueList getValueList(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") public void setValueList(ValueList valueList); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueId") public Reference getValueId(); - @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueId") + @JsonProperty("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueId") public void setValueId(Reference valueId); } diff --git a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java index af4615037..9fab7b04c 100644 --- a/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-rdf/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/mixins/EmbeddedDataSpecificationMixin.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -31,10 +31,10 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "@type") public interface EmbeddedDataSpecificationMixin { @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public DataSpecificationIEC61360 getDataSpecificationContent(); + public DataSpecificationIec61360 getDataSpecificationContent(); @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") - public void setDataSpecificationContent(DataSpecificationIEC61360 dataSpecificationContent); + public void setDataSpecificationContent(DataSpecificationIec61360 dataSpecificationContent); @JsonProperty("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") public Reference getDataSpecification(); diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java index 8d603f749..1d9a4f500 100644 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/ParserTest.java @@ -111,7 +111,7 @@ public void deserializeConceptDescription() throws IOException, DeserializationE " \"@context\" : {\n" + " \"aas\" : \"https://admin-shell.io/aas/3/0/RC02/\",\n" + " \"phys_unit\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/\",\n" + - " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC02/\"\n" + + " \"iec61360\" : \"https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC02/\"\n" + " },\n" + " \"@id\" : \"https://admin-shell.io/autogen/DefaultConceptDescription/c6bd22b3-6487-49d2-a86d-e3834d22ceb9\",\n" + " \"@type\" : \"aas:ConceptDescription\",\n" + @@ -130,15 +130,15 @@ public void deserializeConceptDescription() throws IOException, DeserializationE " } ]\n" + " },\n" + " \"https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent\" : {\n" + - " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIEC61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + - " \"@type\" : \"iec61360:DataSpecificationIEC61360\",\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType\" : {\n" + - " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360\",\n" + + " \"@id\" : \"https://admin-shell.io/autogen/DefaultDataSpecificationIec61360/457288b3-77e1-474a-ab74-866bdcafd914\",\n" + + " \"@type\" : \"iec61360:DataSpecificationIec61360\",\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType\" : {\n" + + " \"@type\" : \"https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360\",\n" + " \"@id\" : \"https://admin-shell.io/aas/3/0/RC02/RATIONAL\"\n" + " },\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName\" : [ ],\n" + - " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName\" : [ ]\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName\" : [ ],\n" + + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName\" : [ ]\n" + " },\n" + " \"https://admin-shell.io/aas/3/0/RC02/DataSpecification/id\" : \"http://example.org/DataSpecification1\"\n" + " } ]\n" + diff --git a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java index 2d7d56c03..244e98aa1 100644 --- a/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java +++ b/dataformat-rdf/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/rdf/SerializerTest.java @@ -24,7 +24,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.junit.Assert; import org.junit.Test; @@ -70,8 +70,8 @@ public void serializeEnvironment() throws IOException, DeserializationException .value("https://example.org") .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIEC61360.Builder() - .dataType(DataTypeIEC61360.RATIONAL) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .dataType(DataTypeIec61360.RATIONAL) .build()) .build()) .build(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 45caad7c9..209c72ff3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -25,10 +25,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DataSpecificationManager; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import java.io.IOException; import java.util.Collections; @@ -57,13 +57,13 @@ private JsonNode getReferenceNode(JsonParser parser, JsonNode node) throws JsonM private List createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { JsonNode nodeContent = node.get(DataSpecificationManager.PROP_DATA_SPECIFICATION_CONTENT); - JsonNode specificationNode = nodeContent.get("dataSpecificationIEC61360"); - DataSpecificationContent content = createDefaultDataSpecificationIEC61360FromNode(parser, specificationNode); + JsonNode specificationNode = nodeContent.get("DataSpecificationIec61360"); + DataSpecificationContent content = createDefaultDataSpecificationIec61360FromNode(parser, specificationNode); return Collections.singletonList(content); } - private DataSpecificationContent createDefaultDataSpecificationIEC61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIEC61360.class); + private DataSpecificationContent createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { + return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 7698c1926..a83d708ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -27,8 +27,8 @@ import java.util.List; @JsonPropertyOrder({"preferredName", "shortName", "unit", "unitId", "sourceOfDefinition", "symbol", "dataType", "definition", "valueFormat", "valueList", "value", "valueId", "levelType"}) -//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationIec61360") -public interface DataSpecificationIEC61360Mixin { +//@JacksonXmlRootElement(namespace = AasXmlNamespaceContext.AAS_URI, localName = "DataSpecificationIec61360") +public interface DataSpecificationIec61360Mixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "definition") public List getDefinition(); @@ -82,6 +82,6 @@ public interface DataSpecificationIEC61360Mixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") @JsonSerialize(using = EnumSerializer.class) - public DataTypeIEC61360 getDataType(); + public DataTypeIec61360 getDataType(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java index 3b5bfe6fe..bc89c01f9 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java @@ -31,6 +31,6 @@ public interface EmbeddedDataSpecificationMixin { @JacksonXmlElementWrapper(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataSpecificationContent") @JsonSerialize(using = EmbeddedDataSpecificationSerializer.class) - public DataSpecificationIEC61360 getDataSpecificationContent(); + public DataSpecificationIec61360 getDataSpecificationContent(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 9bf5216df..5766c9532 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -18,7 +18,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 385e36446..7f9211a17 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,7 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java index 3d9ee0220..2e815400d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java @@ -23,7 +23,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIdMixin { +public interface SpecificAssetIDMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index cbad40cc0..cc25e2ef6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index aa99ff032..734b2b4af 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,12 +35,12 @@ * reference. */ // TODO: solve EmbeddedDataSpecifiction issue -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); @Override - public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; @@ -48,13 +48,13 @@ public void serialize(DataSpecificationIEC61360 data, JsonGenerator generator, S // generator.writeFieldName(PROP_DATA_SPECIFICATION_CONTENT); generator.writeStartObject(); // TODO: Add field name according to template type - generator.writeObjectField("dataSpecificationIec61360", data); + generator.writeObjectField("DataSpecificationIec61360", data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIEC61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java index b2ef9cc4a..5b2659d1a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java index 124298da8..8fcb1be17 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -52,7 +52,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the LangStringSet for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - List getDescription(); + List getDescription(); /** * @@ -60,7 +60,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * @@ -69,7 +69,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the LangStringSet for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - List getDisplayName(); + List getDisplayName(); /** * @@ -77,7 +77,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 689bb3568..0664d8bed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -77,7 +77,7 @@ public interface AssetInformation { * @return Returns the Reference for the property globalAssetId. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - Reference getGlobalAssetId(); + String getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. @@ -86,7 +86,7 @@ public interface AssetInformation { * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(Reference globalAssetId); + void setGlobalAssetId(String globalAssetId); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 2bb5a92e7..2a5a59ae6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -26,7 +26,7 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIEC61360.class), + @KnownSubtypes.Type(value = DataSpecificationIec61360.class), @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 1848854db..1ab999fd6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIEC61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import java.util.List; @@ -27,43 +27,43 @@ * lists conformant to IEC 61360. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationIEC61360.class) + @KnownSubtypes.Type(value = DefaultDataSpecificationIec61360.class) }) -public interface DataSpecificationIEC61360 extends DataSpecificationContent { +public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType * - * @return Returns the DataTypeIEC61360 for the property dataType. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - DataTypeIEC61360 getDataType(); + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType * * @param dataType desired value for the property dataType. */ - void setDataType(DataTypeIEC61360 dataType); + void setDataType(DataTypeIec61360 dataType); /** * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition * * @return Returns the List of LangStrings for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") List getDefinition(); /** * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition * * @param definition desired value for the property definition. */ @@ -72,17 +72,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType * * @return Returns the LevelType for the property levelType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") LevelType getLevelType(); /** * Set of levels. * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType * * @param levelType desired value for the property levelType. */ @@ -92,18 +92,18 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { * Preferred name * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName * * @return Returns the List of LangStrings for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") List getPreferredName(); /** * Preferred name * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName * * @param preferredName desired value for the property preferredName. */ @@ -112,17 +112,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName * * @return Returns the List of LangStrings for the property shortName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") List getShortName(); /** * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName * * @param shortName desired value for the property shortName. */ @@ -132,18 +132,18 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -152,17 +152,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol * * @param symbol desired value for the property symbol. */ @@ -171,17 +171,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Unit * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit * * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") String getUnit(); /** * Unit * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit * * @param unit desired value for the property unit. */ @@ -190,17 +190,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId * * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") Reference getUnitId(); /** * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId * * @param unitId desired value for the property unitId. */ @@ -209,17 +209,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Value * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") String getValue(); /** * Value * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value * * @param value desired value for the property value. */ @@ -228,17 +228,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -247,17 +247,17 @@ public interface DataSpecificationIEC61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList + * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList * * @param valueList desired value for the property valueList. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index b78e2c83a..fd884386a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -22,129 +22,129 @@ /** */ -@IRI("aas:DataTypeIEC61360") -public enum DataTypeIEC61360 { +@IRI("aas:DataTypeIec61360") +public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Date") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/File") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Html") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/String") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Time") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIEC61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 422cdb746..77ca80168 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -57,7 +57,7 @@ public interface Entity extends SubmodelElement { * @return Returns the Reference for the property globalAssetId. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - Reference getGlobalAssetId(); + String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. @@ -66,7 +66,7 @@ public interface Entity extends SubmodelElement { * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(Reference globalAssetId); + void setGlobalAssetId(String globalAssetId); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index e3ab34e5f..51b946890 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -23,26 +23,30 @@ /** */ @IRI("aas:LevelType") -public enum LevelType { - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Max") - MAX, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Min") - MIN, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Nom") - NOM, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/LevelType/Typ") - TYP; +public interface LevelType { + + + public boolean getMin(); + + + public void setMin(boolean min); + + + public boolean getNom(); + + + public void setNom(boolean nom); + + + public boolean getTyp(); + + + public void setTyp(boolean typ); + + + public boolean getMax(); + + + public void setMax(boolean max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index 3ab965e2d..6b91d51af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -38,7 +38,7 @@ public interface MultiLanguageProperty extends DataElement { * @return Returns the List of LangStrings for the property value. */ @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - List getValue(); + List getValue(); /** * The value of the property instance. @@ -47,7 +47,7 @@ public interface MultiLanguageProperty extends DataElement { * * @param value desired value for the property value. */ - void setValue(List value); + void setValue(List value); /** * Reference to the global unique ID of a coded value. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 87346d826..e0fd5497d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -80,7 +80,7 @@ public interface Referable extends HasExtensions { * @return Returns the List of LangStrings for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); + List getDescription(); /** * Description or comments on the element. @@ -89,7 +89,7 @@ public interface Referable extends HasExtensions { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * Display name. Can be provided in several languages. @@ -99,7 +99,7 @@ public interface Referable extends HasExtensions { * @return Returns the List of LangStrings for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - List getDisplayName(); + List getDisplayName(); /** * Display name. Can be provided in several languages. @@ -108,7 +108,7 @@ public interface Referable extends HasExtensions { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** * In case of identifiables this attribute is a short name of the element. In case of referable this diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index fa65393f9..2f815c8a8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -29,8 +29,8 @@ public enum ReferenceTypes { /** * GlobalReference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/GlobalReference") - GLOBAL_REFERENCE, + @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ExternalReference") + EXTERNAL_REFERENCE, /** * ModelReference diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java index 83a51cfb4..b4173aa09 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -52,7 +52,7 @@ public interface SubmodelDescriptor extends Descriptor { * @return Returns the LangStringSet for the property description. */ @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - List getDescription(); + List getDescription(); /** * @@ -60,7 +60,7 @@ public interface SubmodelDescriptor extends Descriptor { * * @param description desired value for the property description. */ - void setDescription(List description); + void setDescription(List description); /** * @@ -69,7 +69,7 @@ public interface SubmodelDescriptor extends Descriptor { * @return Returns the LangStringSet for the property displayName. */ @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - List getDisplayName(); + List getDisplayName(); /** * @@ -77,7 +77,7 @@ public interface SubmodelDescriptor extends Descriptor { * * @param displayName desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayName); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index ce53cdd63..995eeabd7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -187,7 +187,7 @@ public B idShort(String idShort) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -198,7 +198,7 @@ public B displayName(List displayName) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 4bd31ea8d..12cf93d6f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -139,7 +139,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -172,7 +172,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java index 2a4ba9612..950eb0017 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -39,7 +39,7 @@ public B administration(AdministrativeInformation administration) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -50,7 +50,7 @@ public B description(List description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 8ef76deb5..5e56f3aa1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -51,7 +51,7 @@ public B defaultThumbnail(Resource defaultThumbnail) { * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(Reference globalAssetId) { + public B globalAssetId(String globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 6a3d80774..142160c2e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -205,7 +205,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -216,7 +216,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -227,7 +227,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -238,7 +238,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index f31291130..cc3569b14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -138,7 +138,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -149,7 +149,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -171,7 +171,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 2fcf75982..9fef383bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -116,7 +116,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -127,7 +127,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -138,7 +138,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -149,7 +149,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 68dee27fb..3977d3764 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -117,7 +117,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -128,7 +128,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -139,7 +139,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -150,7 +150,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index a37a1b854..e48eca4ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -20,7 +20,7 @@ import java.util.List; -public abstract class DataSpecificationIEC61360Builder> +public abstract class DataSpecificationIec61360Builder> extends ExtendableBuilder { /** @@ -29,7 +29,7 @@ public abstract class DataSpecificationIEC61360Builder description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -182,7 +182,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -193,7 +193,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -204,7 +204,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index e8585a2da..28fae5424 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -138,7 +138,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -149,7 +149,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -171,7 +171,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 8e00bcb14..0a6a178fc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -29,7 +29,7 @@ public abstract class MultiLanguagePropertyBuilder value) { + public B value(List value) { getBuildingInstance().setValue(value); return getSelf(); } @@ -40,7 +40,7 @@ public B value(List value) { * @param value desired value to be added * @return Builder object with new value for value */ - public B value(LangString value) { + public B value(LangStringTextType value) { getBuildingInstance().getValue().add(value); return getSelf(); } @@ -150,7 +150,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -172,7 +172,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -183,7 +183,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 7ab8280cb..d54a79149 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -182,7 +182,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -193,7 +193,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -204,7 +204,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -215,7 +215,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index fb89de487..de36ed0dd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -149,7 +149,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -171,7 +171,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -182,7 +182,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 35472b5f4..35a2a059a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -149,7 +149,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -160,7 +160,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -171,7 +171,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -182,7 +182,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index e7eabbeec..04c10f8e4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -128,7 +128,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -139,7 +139,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -161,7 +161,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index b5fa9c32b..90dc6d0b1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -139,7 +139,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -150,7 +150,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -161,7 +161,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -172,7 +172,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index a4a25425c..1bc4b9a66 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -116,7 +116,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -127,7 +127,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -138,7 +138,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -149,7 +149,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java index 76f32ed66..178fcb391 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -19,7 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; @@ -43,7 +44,7 @@ public B administration(AdministrativeInformation administration) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -54,7 +55,7 @@ public B description(List description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index dbaa9905b..fb37809e6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -140,7 +140,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -151,7 +151,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -162,7 +162,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -173,7 +173,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index f677a5553..cabcd023c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -183,7 +183,7 @@ public B checksum(String checksum) { * @param description desired value to be set * @return Builder object with new value for description */ - public B description(List description) { + public B description(List description) { getBuildingInstance().setDescription(description); return getSelf(); } @@ -194,7 +194,7 @@ public B description(List description) { * @param description desired value to be added * @return Builder object with new value for description */ - public B description(LangString description) { + public B description(LangStringTextType description) { getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -205,7 +205,7 @@ public B description(LangString description) { * @param displayName desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { + public B displayName(List displayName) { getBuildingInstance().setDisplayName(displayName); return getSelf(); } @@ -216,7 +216,7 @@ public B displayName(List displayName) { * @param displayName desired value to be added * @return Builder object with new value for displayName */ - public B displayName(LangString displayName) { + public B displayName(LangStringNameType displayName) { getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index b92558245..902dac60a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -63,10 +63,10 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index ffc80b112..cd4830dff 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -61,10 +61,10 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -195,22 +195,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index 998f3dd4e..634590eab 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -33,10 +33,10 @@ public class DefaultAssetAdministrationShellDescriptor implements AssetAdministr protected AdministrativeInformation administration; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - protected List description; + protected List description; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - protected List displayName; + protected List displayName; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") protected String idShort; @@ -103,22 +103,22 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index 9b31fb191..a3f9112aa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -41,7 +41,7 @@ public class DefaultAssetInformation implements AssetInformation { protected Resource defaultThumbnail; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") - protected Reference globalAssetId; + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); @@ -96,12 +96,12 @@ public void setDefaultThumbnail(Resource defaultThumbnail) { } @Override - public Reference getGlobalAssetId() { + public String getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(Reference globalAssetId) { + public void setGlobalAssetId(String globalAssetId) { this.globalAssetId = globalAssetId; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 7cdf7feb7..25616f747 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -82,10 +82,10 @@ public class DefaultBasicEventElement implements BasicEventElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -292,22 +292,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 682d2d09d..47e6fca08 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -66,10 +66,10 @@ public class DefaultBlob implements Blob { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -206,22 +206,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 0a2a528a0..2201e9b54 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -59,10 +59,10 @@ public class DefaultCapability implements Capability { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -173,22 +173,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index d0b7fcbb6..cbf4079e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -56,10 +56,10 @@ public class DefaultConceptDescription implements ConceptDescription { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -168,22 +168,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 7c26835ce..4b97ea5e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIEC61360Builder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; import java.util.ArrayList; import java.util.List; @@ -26,52 +26,52 @@ /** * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIEC61360 + * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360 * * Content of data specification template for concept descriptions for properties, values and value * lists conformant to IEC 61360. */ -@IRI("aas:DataSpecificationIEC61360") -public class DefaultDataSpecificationIEC61360 implements DataSpecificationIEC61360 { +@IRI("aas:DataSpecificationIec61360") +public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/dataType") - protected DataTypeIEC61360 dataType; + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/preferredName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/shortName") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unit") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/value") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIEC61360() { + public DefaultDataSpecificationIec61360() { } @@ -100,7 +100,7 @@ public boolean equals(Object obj) { } else if (this.getClass() != obj.getClass()) { return false; } else { - DefaultDataSpecificationIEC61360 other = (DefaultDataSpecificationIEC61360) obj; + DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; return Objects.equals(this.dataType, other.dataType) && Objects.equals(this.definition, other.definition) && Objects.equals(this.levelType, other.levelType) && @@ -117,12 +117,12 @@ public boolean equals(Object obj) { } @Override - public DataTypeIEC61360 getDataType() { + public DataTypeIec61360 getDataType() { return dataType; } @Override - public void setDataType(DataTypeIEC61360 dataType) { + public void setDataType(DataTypeIec61360 dataType) { this.dataType = dataType; } @@ -237,9 +237,9 @@ public void setValueList(ValueList valueList) { } /** - * This builder class can be used to construct a DefaultDataSpecificationIEC61360 bean. + * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ - public static class Builder extends DataSpecificationIEC61360Builder { + public static class Builder extends DataSpecificationIec61360Builder { @Override protected Builder getSelf() { @@ -247,8 +247,8 @@ protected Builder getSelf() { } @Override - protected DefaultDataSpecificationIEC61360 newBuildingInstance() { - return new DefaultDataSpecificationIEC61360(); + protected DefaultDataSpecificationIec61360 newBuildingInstance() { + return new DefaultDataSpecificationIec61360(); } } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index 979271811..7c50e9497 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -37,7 +37,7 @@ public class DefaultEntity implements Entity { protected EntityType entityType; @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") - protected Reference globalAssetId; + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") protected SpecificAssetId specificAssetId; @@ -70,10 +70,10 @@ public class DefaultEntity implements Entity { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -142,12 +142,12 @@ public void setEntityType(EntityType entityType) { } @Override - public Reference getGlobalAssetId() { + public String getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(Reference globalAssetId) { + public void setGlobalAssetId(String globalAssetId) { this.globalAssetId = globalAssetId; } @@ -232,22 +232,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 543eafd41..07fbdc6ae 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -64,10 +64,10 @@ public class DefaultFile implements File { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -204,22 +204,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 0bdc7638a..f145a7e5d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -49,7 +49,7 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected List supplementalSemanticIds = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") - protected List value = new ArrayList<>(); + protected List value = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") protected Reference valueId; @@ -64,10 +64,10 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -124,12 +124,12 @@ public boolean equals(Object obj) { } @Override - public List getValue() { + public List getValue() { return value; } @Override - public void setValue(List value) { + public void setValue(List value) { this.value = value; } @@ -204,22 +204,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index fe8d5e818..570604091 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -67,10 +67,10 @@ public class DefaultOperation implements Operation { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -217,22 +217,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index a83c00054..29a8c7c06 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -67,10 +67,10 @@ public class DefaultProperty implements Property { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 1b1b12f53..ce1dcb808 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -67,10 +67,10 @@ public class DefaultRange implements Range { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -219,22 +219,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 23c2f26da..730521770 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -59,10 +59,10 @@ public class DefaultReferenceElement implements ReferenceElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -190,22 +190,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 99361ba3c..31ce95a0c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -59,10 +59,10 @@ public class DefaultRelationshipElement implements RelationshipElement { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -203,22 +203,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index a1e816feb..1eb569d42 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -64,10 +64,10 @@ public class DefaultSubmodel implements Submodel { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -187,22 +187,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java index 580519f78..0c40ea39d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -21,7 +21,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -37,10 +38,10 @@ public class DefaultSubmodelDescriptor implements SubmodelDescriptor { protected AdministrativeInformation administration; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - protected List description; + protected List description; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - protected List displayName; + protected List displayName; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") protected String idShort; @@ -96,22 +97,22 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 5713fbe6b..9db7dacce 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -61,10 +61,10 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -190,22 +190,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index d81d64b4d..631726d88 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -58,10 +58,10 @@ public class DefaultSubmodelElementList implements SubmodelElementList { protected String checksum; @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - protected List description = new ArrayList<>(); + protected List description = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") - protected List displayName = new ArrayList<>(); + protected List displayName = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") protected String idShort; @@ -248,22 +248,22 @@ public void setChecksum(String checksum) { } @Override - public List getDescription() { + public List getDescription() { return description; } @Override - public void setDescription(List description) { + public void setDescription(List description) { this.description = description; } @Override - public List getDisplayName() { + public List getDisplayName() { return displayName; } @Override - public void setDisplayName(List displayName) { + public void setDisplayName(List displayName) { this.displayName = displayName; } diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java index 1a0f04aab..6afccaaf8 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_006.java @@ -23,8 +23,8 @@ *

* For a ConceptDescription with category DOCUMENT using data specification * template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - * - DataSpecificationIEC61360/dataType shall be one of the following values: + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) + * - DataSpecificationIec61360/dataType shall be one of the following values: * STRING or URL. *

* @@ -37,37 +37,37 @@ public class TestAASc_006 { /* @Test public void correctDataTypeURL() throws ValidationException, IOException { - ConceptDescription correctURLCD = createConceptDescription(DataTypeIEC61360.URL); + ConceptDescription correctURLCD = createConceptDescription(DataTypeIec61360.URL); ShaclValidator.getInstance().validate(correctURLCD); } @Test public void wrongDataType() { - ConceptDescription wrongCD = createConceptDescription(DataTypeIEC61360.DATE); + ConceptDescription wrongCD = createConceptDescription(DataTypeIec61360.DATE); try { ShaclValidator.getInstance().validate(wrongCD); fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "For a ConceptDescription with category DOCUMENT using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - DataSpecificationIEC61360/dataType shall be one of the following values: String or URL.")); + "For a ConceptDescription with category DOCUMENT using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) - DataSpecificationIec61360/dataType shall be one of the following values: String or URL.")); } } @Test public void correctDataTypeString() throws ValidationException { - ConceptDescription correctStringCD = createConceptDescription(DataTypeIEC61360.STRING); + ConceptDescription correctStringCD = createConceptDescription(DataTypeIec61360.STRING); ShaclValidator.getInstance().validate(correctStringCD); } - private ConceptDescription createConceptDescription(DataTypeIEC61360 dataType) { + private ConceptDescription createConceptDescription(DataTypeIec61360 dataType) { ConceptDescription correctURLCD = ConstraintTestHelper.createConceptDescription("idShort1", "conceptDescriptionURL", "DOCUMENT"); - DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() + DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() .preferredName(new LangString("ds", "en")).definition(new LangString("some english definition", "EN")) .dataType(dataType).build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java index d5a07baa7..7a975148b 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASc_008.java @@ -31,8 +31,8 @@ *

* For all ConceptDescriptions except for ConceptDescriptions of category * VALUE using data specification template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) - * - DataSpecificationIEC61360/definition is mandatory and shall be defined at + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) + * - DataSpecificationIec61360/definition is mandatory and shall be defined at * least in English. *

* @@ -60,7 +60,7 @@ public void conceptDescriptionNoEnglishDefinition() { } catch (ValidationException e) { System.out.println(e.getMessage()); assertTrue(e.getMessage().endsWith( - "For all ConceptDescriptions except for ConceptDescriptions of category VALUE using data specification template IEC61360 (https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360/definition) - DataSpecificationIEC61360/definition is mandatory and shall be defined at least in English.")); + "For all ConceptDescriptions except for ConceptDescriptions of category VALUE using data specification template IEC61360 (https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition) - DataSpecificationIec61360/definition is mandatory and shall be defined at least in English.")); } } @@ -84,11 +84,11 @@ private ConceptDescription createConceptDescription(LangString definition) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", "id", "QUALIFIER"); - DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() + DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() .preferredName(new DefaultLangString.Builder().language("en").text("ds").build()) .definition(definition) .definition(new DefaultLangString.Builder().language("de").text("test").build()) - .dataType(DataTypeIEC61360.IRI) + .dataType(DataTypeIec61360.IRI) .build(); EmbeddedDataSpecification urlDataTypeEDS = new DefaultEmbeddedDataSpecification.Builder() diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java index 2c1f20f48..7c689b9cb 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_067.java @@ -31,7 +31,7 @@ * Tests the following constraint: *

* If the semanticId of a MultiLanguageProperty references a ConceptDescription then - * DataSpecificationIEC61360/dataType shall be STRING_TRANSLATABLE. + * DataSpecificationIec61360/dataType shall be STRING_TRANSLATABLE. *

* * @author bader, chang @@ -42,8 +42,8 @@ public class TestAASd_067 { @Test public void wrongConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.DATE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.DATE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Wrong Data Specification", "en")) // .definition(new LangString("A definition of a Date in English.", "en")) // .build(); @@ -84,7 +84,7 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a MultiLanguageProperty references a ConceptDescription then DataSpecificationIEC61360/dataType shall be STRING_TRANSLATABLE.")); + "If the semanticId of a MultiLanguageProperty references a ConceptDescription then DataSpecificationIec61360/dataType shall be STRING_TRANSLATABLE.")); } @@ -94,8 +94,8 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { public void correctConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java index c239a4d32..2bfd6694c 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_068.java @@ -31,7 +31,7 @@ * Tests the following constraint: *

* If the semanticId of a Range submodel element references a ConceptDescription then - * DataSpecificationIEC61360/dataType shall be a numerical one, i.e. REAL_* or RATIONAL_*. + * DataSpecificationIec61360/dataType shall be a numerical one, i.e. REAL_* or RATIONAL_*. *

* * @author bader, chang @@ -42,8 +42,8 @@ public class TestAASd_068 { @Test public void wrongConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.INTEGER_COUNT) // This should be DataTypeIEC61360.REAL_* or RATIONAL_* +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.INTEGER_COUNT) // This should be DataTypeIec61360.REAL_* or RATIONAL_* // .preferredName(new LangString("Wrong Data Specification", "en")) // .definition(new LangString("A definition of a Date in English.", "en")) // .build(); @@ -87,7 +87,7 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith("If the semanticId of a Range submodel element references a " + - "ConceptDescription then DataSpecificationIEC61360/dataType shall be a numerical one, i.e. " + + "ConceptDescription then DataSpecificationIec61360/dataType shall be a numerical one, i.e. " + "Real* or Rational*.")); } @@ -98,8 +98,8 @@ public void wrongConceptDescriptionDatatype() throws ValidationException { public void correctRealConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.REAL_COUNT) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.REAL_COUNT) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a REAL_COUNT in English.", "en")) // .build(); @@ -148,8 +148,8 @@ public void correctRealConceptDescriptionDatatype() throws ValidationException { public void correctRationalConceptDescriptionDatatype() throws ValidationException { -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.RATIONAL_MEASURE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.RATIONAL_MEASURE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a RATIONAL_MEASURE in English.", "en")) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java index 5010d3fe2..6d84ecbe9 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_069.java @@ -33,7 +33,7 @@ * Tests the following constraint: *

* If the semanticId of a Range references a ConceptDescription then - * DataSpecificationIEC61360/levelType shall be identical to the set {Min, Max}. + * DataSpecificationIec61360/levelType shall be identical to the set {Min, Max}. * *

* @@ -76,7 +76,7 @@ public void wrongLevelTypes() { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a Range references a ConceptDescription then DataSpecificationIEC61360/levelType shall be identical to the set {Min, Max}.")); + "If the semanticId of a Range references a ConceptDescription then DataSpecificationIec61360/levelType shall be identical to the set {Min, Max}.")); } } @@ -99,10 +99,10 @@ private ConceptDescription getCDWithLevelType(String conceptDescriptionId) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", conceptDescriptionId, "PROPERTY"); -// DataSpecificationIEC61360 stringDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 stringDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(new LangString("ds", "EN")) // .definition(new LangString("some english definition", "EN")) -// .dataType(DataTypeIEC61360.REAL_MEASURE) +// .dataType(DataTypeIec61360.REAL_MEASURE) // .levelTypes(Arrays.asList(LevelType.MIN, LevelType.MAX)) // .build(); @@ -126,10 +126,10 @@ private ConceptDescription getCDWithWrongLevelType(String conceptDescriptionId) ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", conceptDescriptionId, "PROPERTY"); -// DataSpecificationIEC61360 stringDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 stringDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(new LangString("ds", "EN")) // .definition(new LangString("some english definition", "EN")) -// .dataType(DataTypeIEC61360.STRING) +// .dataType(DataTypeIec61360.STRING) // .levelTypes(Arrays.asList(LevelType.NOM, LevelType.MAX)) // .build(); diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java index d27b080ad..8d4754c69 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_076.java @@ -29,7 +29,7 @@ * Tests the following constraint: *

* For all ConceptDescriptions using data specification template IEC61360 - * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) + * (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) * at least a preferred name in English shall be defined. *

* @@ -68,7 +68,7 @@ public void noEnglishPreferredName() { } catch (ValidationException e) { System.out.println(e.getMessage()); assertTrue(e.getMessage().endsWith( - "For all ConceptDescriptions using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0) at least a preferred name in English shall be defined.")); + "For all ConceptDescriptions using data specification template IEC61360 (http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0) at least a preferred name in English shall be defined.")); } } @@ -76,11 +76,11 @@ private ConceptDescription createConceptDescription(LangString preferredName) { ConceptDescription cd = ConstraintTestHelper.createConceptDescription("idShort1", "id", "QUALIFIER"); -// DataSpecificationIEC61360 urlDataTypeDS = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 urlDataTypeDS = new DefaultDataSpecificationIec61360.Builder() // .preferredName(preferredName) // .preferredName(new LangString("test", "de")) // .definition(new LangString("definition", "en")) -// .dataType(DataTypeIEC61360.URL) +// .dataType(DataTypeIec61360.URL) // .build(); // EmbeddedDataSpecification urlDataTypeEDS = new DefaultEmbeddedDataSpecification.Builder() diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java index 62cd05c38..63be0ce4d 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_65a.java @@ -31,8 +31,8 @@ * Tests the following constraint: *

* If the semanticId of a Property references a ConceptDescription with the category VALUE - * then the value of the property is identical to DataSpecificationIEC61360/value and the valueId of - * the property is identical to DataSpecificationIEC61360/valueId. + * then the value of the property is identical to DataSpecificationIec61360/value and the valueId of + * the property is identical to DataSpecificationIec61360/valueId. *

* * @author bader, chang @@ -50,27 +50,27 @@ public void missmatchingValueAndValueId() throws ValidationException { .value("the value of property") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("DataSpecificationIEC61360") + .value("DataSpecificationIec61360") .type(KeyTypes.GLOBAL_REFERENCE) .build()) .build()) .valueType(DataTypeDefXsd.STRING) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataTypeIEC61360") + .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC01/DataTypeIec61360") .type(KeyTypes.CONCEPT_DESCRIPTION) .build()) .build()) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .value("the value") // .valueId(new DefaultReference.Builder(). // keys(new DefaultKey.Builder() -// .value("DataSpecificationIEC61360") +// .value("DataSpecificationIec61360") // // .type(KeyTypes.GLOBAL_REFERENCE) // .build()) @@ -112,7 +112,7 @@ public void matchingValueAndValueId() throws ValidationException { .value("the value of Property value") .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("DataSpecificationIEC61360") + .value("DataSpecificationIec61360") .type(KeyTypes.GLOBAL_REFERENCE) .build()) @@ -121,20 +121,20 @@ public void matchingValueAndValueId() throws ValidationException { .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0/RC01/DataTypeIEC61360") + .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/3/0/RC01/DataTypeIec61360") .type(KeyTypes.CONCEPT_DESCRIPTION) .build()) .build()) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .value("the value of Property value") // .valueId(new DefaultReference.Builder(). // keys(new DefaultKey.Builder() -// .value("DataSpecificationIEC61360") +// .value("DataSpecificationIec61360") // // .type(KeyTypes.GLOBAL_REFERENCE) // .build()) diff --git a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java index 2221df83d..0d81577c5 100644 --- a/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java +++ b/validator/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/validator/TestAASd_66a.java @@ -30,7 +30,7 @@ /** * Tests the following constraint: *

- * If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIEC61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, + * If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIec61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, * i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp. *

* @@ -52,7 +52,7 @@ public void wrongValueReferencePairTypesValue() throws ValidationException { .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() // .valueList(new DefaultValueList.Builder() // .valueReferencePairTypes(new DefaultValueReferencePair.Builder() // .value("This is not identical to Multilanguage property value.") @@ -100,7 +100,7 @@ public void wrongValueReferencePairTypesValue() throws ValidationException { fail(); } catch (ValidationException e) { assertTrue(e.getMessage().endsWith( - "If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIEC61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp.")); + "If the semanticId of a MultiLanguageProperty or MultiLanguageMultiLanguageProperty references a ConceptDescription with the category MultiLanguageProperty and DataSpecificationIec61360/valueList is defined the value and valueId of the MultiLanguageProperty is identical to one of the value reference pair types references in the value list, i.e. ValueReferencePairType/value or ValueReferencePairType/valueId, resp.")); } } @@ -115,8 +115,8 @@ public void correctConceptDescriptionDatatype() throws ValidationException { .type(ReferenceTypes.GLOBAL_REFERENCE) .build(); -// DataSpecificationIEC61360 ds = new DefaultDataSpecificationIEC61360.Builder() -// .dataType(DataTypeIEC61360.STRING_TRANSLATABLE) // This should be DataTypeIEC61360.STRING_TRANSLATABLE +// DataSpecificationIec61360 ds = new DefaultDataSpecificationIec61360.Builder() +// .dataType(DataTypeIec61360.STRING_TRANSLATABLE) // This should be DataTypeIec61360.STRING_TRANSLATABLE // .preferredName(new LangString("Data Specification", "en")) // .definition(new LangString("A definition of a STRING_TRANSLATABLE in English.", "en")) // .valueList(new DefaultValueList.Builder() From 651a3831c543af207386453224cbf593cab8c7ff Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 15:23:36 +0200 Subject: [PATCH 14/91] fix compile errors --- .../v3/dataformat/aasx/AASXDeserializer.java | 2 +- .../v3/dataformat/aasx/AASXSerializer.java | 2 +- .../v3/dataformat/core/util/AasUtils.java | 4 +- .../v3/dataformat/core/AasUtilsTest.java | 52 --- .../v3/dataformat/json/JsonDeserializer.java | 337 ++++++------------ .../v3/dataformat/json/JsonSerializer.java | 275 ++++++++------ .../json/JsonReferableDeserializerTest.java | 105 ++++-- .../json/JsonReferableSerializerTest.java | 5 +- .../dataformat/json/JsonSerializerTest.java | 2 +- .../xml/serialization/KeySerializer.java | 2 +- 10 files changed, 346 insertions(+), 440 deletions(-) delete mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 5108b7bf9..0b0aa33d9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -169,7 +169,7 @@ private List parseElements(Collection elements) { paths.add(file.getValue()); } else if (element instanceof SubmodelElementCollection) { SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValues())); + paths.addAll(parseElements(collection.getValue())); } } return paths; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 449be54c3..f0456b2ee 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -226,7 +226,7 @@ private Collection findFileElements(Collection elements) files.add((File) element); } else if (element instanceof SubmodelElementCollection) { // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValues())); + files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); } } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 46985b03e..a4ba8d154 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -332,14 +332,14 @@ public static T resolve(Reference reference, Environment e if (keyType != null) { if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { try { - current = ((SubmodelElementList) current).getValues().get(Integer.parseInt(key.getValue())); + current = ((SubmodelElementList) current).getValue().get(Integer.parseInt(key.getValue())); } catch (NumberFormatException ex) { throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", i, key.getValue())); } catch (IndexOutOfBoundsException ex) { throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", i, - ((SubmodelElementList) current).getValues().size(), + ((SubmodelElementList) current).getValue().size(), key.getValue())); } } else { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java deleted file mode 100644 index 995289faf..000000000 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AasUtilsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; - - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.junit.Assert; -import org.junit.Test; - -public class AasUtilsTest { - - @Test - public void testParseReference() { - Reference reference = AasUtils.parseReference("(ModelReference)[Property]Temperature"); - Assert.assertNotNull(reference); - Assert.assertEquals(1, reference.getKeys().size()); - Assert.assertEquals(KeyTypes.PROPERTY, reference.getKeys().get(0).getType()); - Assert.assertEquals("Temperature", reference.getKeys().get(0).getValue()); - } - - @Test - public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("AnyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasUtils.deserializeEnumName("anyEnum")); - } - - @Test - public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { - final String name = "ANY_ENUM"; - Assert.assertEquals(name, AasUtils.deserializeEnumName(name)); - } -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index d44cafa7f..e5e77c90b 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -15,40 +15,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.util.Map; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +// TODO import io.adminshell.aas.v3.dataformat.core.deserialization.EmbeddedDataSpecificationDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + + /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer { +public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; - - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + // TODO + protected static Map, com.fasterxml.jackson.databind.JsonDeserializer> customDeserializers = Map.of( + /* EmbeddedDataSpecification.class, new EmbeddedDataSpecificationDeserializer() */); public JsonDeserializer() { initTypeResolver(); @@ -62,15 +58,22 @@ protected void buildMapper() { .annotationIntrospector(new ReflectionAnnotationIntrospector()) .addModule(buildEnumModule()) .addModule(buildImplementationModule()) + .addModule(buildCustomDeserializerModule()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } - @SuppressWarnings("unchecked") - private void initTypeResolver() { + protected SimpleModule buildCustomDeserializerModule() { + SimpleModule module = new SimpleModule(); + customDeserializers.forEach(module::addDeserializer); + return module; + } + + private void initTypeResolver() { typeResolver = new SimpleAbstractTypeResolver(); ReflectionHelper.DEFAULT_IMPLEMENTATIONS .stream() + .filter(x -> !customDeserializers.containsKey(x.getInterfaceType())) .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); } @@ -86,255 +89,119 @@ protected SimpleModule buildImplementationModule() { return module; } - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ + @Override public Environment read(String value) throws DeserializationException { try { - return mapper.readValue(value, Environment.class); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); + return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } } - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ + @Override public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); buildMapper(); } - /** - * Deserializes a given string into an instance of the given Referable - * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ public T readReferable(String src, Class outputClass) throws DeserializationException { + @Override + public T readReferable(String referable, Class outputClass) throws DeserializationException { try { - return mapper.readValue(src, outputClass); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + //return mapper.treeToValue(ModelTypeProcessor.preprocess(referable), outputClass); + return mapper.treeToValue(new ObjectMapper().readTree(referable), outputClass); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing Referable", ex); } } - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferables(String referables, Class outputClass) throws DeserializationException { + try { + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // String parsed = mapper.writeValueAsString(ModelTypeProcessor.preprocess(referables)) ; + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(referables)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of Referables", ex); + } } - /** - * Deserializes a given input stream into an instance of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public Reference readReference(String reference) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the Reference", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + @Override + public List readReferences(String references) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of References", ex); + } } - /** - * Deserializes a given file into an instance of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + @Override + public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SpecificAssetId", ex); + } } - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ public List readReferables(String referables, Class outputClass) throws DeserializationException { + @Override + public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - return mapper.readValue(referables, new TypeReference>() { - }); + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; + return mapper.readValue(parsed,new TypeReference>(){}); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); + } } - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + @Override + public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + @Override + public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { + try { + return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); + } } - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + @Override + public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { + try { + String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; + return mapper.readValue(parsed,new TypeReference>(){}); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); + } } -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 563e3506e..6e7ceef7c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -15,35 +15,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Collection; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +// TODO import io.adminshell.aas.v3.dataformat.core.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +// TODO import io.adminshell.aas.v3.model.EmbeddedDataSpecification; + +import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to JSON. + * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to + * JSON. */ -public class JsonSerializer { +public class JsonSerializer implements Serializer, ReferableSerializer, ReferenceSerializer, SpecificAssetIdSerializer, SubmodelDescriptorSerializer, AssetAdministrationShellDescriptorSerializer { protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonSerializer() { buildMapper(); } @@ -53,136 +50,194 @@ protected void buildMapper() { .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .serializationInclusion(JsonInclude.Include.NON_NULL) .addModule(buildEnumModule()) + .addModule(buildCustomSerializerModule()) .annotationIntrospector(new ReflectionAnnotationIntrospector()) .build(); ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); } + protected SimpleModule buildCustomSerializerModule() { + SimpleModule module = new SimpleModule(); + // TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer()); + return module; + } + protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); module.addSerializer(Enum.class, new EnumSerializer()); return module; } - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ + @Override public String write(Environment aasEnvironment) throws SerializationException { try { - return mapper.writeValueAsString(aasEnvironment); + // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore + // return mapper.writeValueAsString(ModelTypeProcessor.postprocess(mapper.valueToTree(aasEnvironment))); + return mapper.writeValueAsString(mapper.valueToTree(aasEnvironment)); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); } } - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeReferable(Referable referable) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(referable)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } + } + + @Override + public String writeReferables(List referables) throws SerializationException { + if(referables.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); + String json = objectWriter.writeValueAsString(referables); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of Referables", ex); + } + } + + @Override + public String writeReference(Reference reference) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(reference)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing Referable", ex); + } + } + + @Override + public String writeReferences(List references) throws SerializationException { + if(references.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); + String json = objectWriter.writeValueAsString(references); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of References", ex); + } } - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); + @Override + public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SpecificAssetId", ex); + } + } + + @Override + public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { + if(specificAssetIds.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); + String json = objectWriter.writeValueAsString(specificAssetIds); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SpecificAssetIds", ex); } } - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); + @Override + public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { + try { + return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing SubmodelDescriptor", ex); } } - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); + @Override + public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { + if(submodelDescriptors.isEmpty()){ + return null; + } + + try { + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); + String json = objectWriter.writeValueAsString(submodelDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of SubmodelDescriptors", ex); + } } - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - public String write(Referable referable) throws SerializationException { + @Override + public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { try { - return mapper.writeValueAsString(referable); + return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); + throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); } } - /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables - * @throws SerializationException if serialization fails - */ - public String write(Collection referables) throws SerializationException { - if (referables == null) { + @Override + public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { + if(assetAdministrationShellDescriptors.isEmpty()){ return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } + } try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); + ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); + String json = objectWriter.writeValueAsString(assetAdministrationShellDescriptors); + + return mapper.writeValueAsString(this.mapper.readTree(json)); + } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); + throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); } } -} + + + +// @Override +// public String write(Object aas_element) throws SerializationException { +// try { +// // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore +// //return mapper.writeValueAsString(ModelTypeProcessor.postprocess(this.mapper.readTree(json))); +// return mapper.writeValueAsString(mapper.valueToTree(aas_element)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing an aas-element", ex); +// } +// } + +// @Override +// public String writeList(List aas_elements, Class outputClass) throws SerializationException { +// if(aas_elements.isEmpty()){ +// return null; +// } +// +// try { +// ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, outputClass)); +// String json = objectWriter.writeValueAsString(aas_elements); +// +// return mapper.writeValueAsString(this.mapper.readTree(json)); +// +// } catch (JsonProcessingException ex) { +// throw new SerializationException("error serializing list of AAS elements", ex); +// } +// } +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 68ef1d473..f2edff15d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -17,84 +17,119 @@ import static org.junit.Assert.assertEquals; +import java.io.File; import java.io.IOException; -import java.util.Collections; +import java.nio.file.Files; +import java.util.Arrays; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; + import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { + private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); + @Test public void testReadAAS() throws IOException, DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); + + assertEquals(aasExpected, aas); } @Test public void testReadAASs() throws IOException, DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); + String expected = Files.readString(fileExpected.toPath()); + List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); + Environment environment = AASFull.ENVIRONMENT; + List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) + ,environment.getAssetAdministrationShells().get(1)) ; + + assertEquals(aasExpected, aas); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodel.json"); + String expected = Files.readString(fileExpected.toPath()); + Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + Submodel submodelExpected = environment.getSubmodels().get(0); + + assertEquals(submodelExpected, submodel); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelList.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); + + assertEquals(submodelsExpected, submodels); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElement.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); + + assertEquals(submodelElementExpected, submodelElement); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); + String expected = Files.readString(fileExpected.toPath()); + List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); + Environment environment = AASFull.ENVIRONMENT; + List submodelElementsExpected = Arrays.asList( + environment.getSubmodels().get(0).getSubmodelElements().get(0), + environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; + + assertEquals(submodelElementsExpected, submodelElements); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementList.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; + + assertEquals(submodelElementListExpected, submodelElementList); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); + File fileExpected = new File("src/test/resources/submodelElementCollection.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); + Environment environment = AASFull.ENVIRONMENT; + SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; + + assertEquals(submodelElementCollectionExpected, submodelElementCollection); } - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 7df276487..882958cd0 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.util.Collection; +import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; @@ -94,10 +95,10 @@ private void compare(ExampleData exampleData) throws IOException, Serializati if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { actual = new JsonSerializer().write((Environment) exampleData.getModel()); } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Referable) exampleData.getModel()); + actual = new JsonSerializer().writeReferable((Referable) exampleData.getModel()); } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().write((Collection) exampleData.getModel()); + actual = new JsonSerializer().writeReferables((List) exampleData.getModel()); } JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 1ea73393e..21c4b2e77 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -78,7 +78,7 @@ public void testSerializeFullExample() throws SerializationException, JSONExcept @Test public void testSerializeEmptyReferableList() throws SerializationException { List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); + String serialized = new JsonSerializer().writeReferables(emptyList); assertEquals("[]", serialized); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java index 8e545b727..b7e2ae19a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -33,7 +33,7 @@ public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers ToXmlGenerator xgen = (ToXmlGenerator) gen; xgen.writeObjectFieldStart("key"); - String keyTypeValue = AasUtils.serializeEnumName(key.getType().toString()); + String keyTypeValue = key.getType().toString(); xgen.setNextIsAttribute(false); xgen.writeFieldName("type"); xgen.writeString(key.getType().name()); From c50a4ac93582b196da3b852612e68549c0608123 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 16:28:41 +0200 Subject: [PATCH 15/91] Adapt the copyright notice --- .../eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java | 2 +- .../org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java | 2 +- .../aas4j/v3/dataformat/core/DataSpecificationManager.java | 2 +- .../digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java | 2 +- .../deserialization/EmbeddedDataSpecificationDeserializer.java | 2 +- .../core/serialization/EmbeddedDataSpecificationSerializer.java | 2 +- .../aas4j/v3/dataformat/core/util/IdentifiableCollector.java | 2 +- .../v3/dataformat/core/util/MostSpecificClassComparator.java | 2 +- .../dataformat/core/util/MostSpecificTypeTokenComparator.java | 2 +- .../core/visitor/AssetAdministrationShellElementVisitor.java | 2 +- .../visitor/AssetAdministrationShellElementWalkerVisitor.java | 2 +- .../eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java | 2 +- .../digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java | 2 +- .../aas4j/v3/dataformat/mapping/MappingException.java | 2 +- .../aas4j/v3/dataformat/mapping/MappingProvider.java | 2 +- .../aas4j/v3/dataformat/mapping/SourceBasedMapper.java | 2 +- .../aas4j/v3/dataformat/mapping/TargetBasedMapper.java | 2 +- .../json/AssetAdministrationShellDescriptorDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferableDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferenceSerializer.java | 2 +- .../aas4j/v3/dataformat/json/mixins/SubmodelMixin.java | 2 +- .../JsonAssetAdministrationShellDescriptorDeserializerTest.java | 2 +- .../JsonAssetAdministrationShellDescriptorSerializerTest.java | 2 +- .../aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java | 2 +- .../aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java | 2 +- .../v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java | 2 +- .../v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java | 2 +- .../dataformat/json/JsonSubmodelDescriptorDeserializerTest.java | 2 +- .../dataformat/json/JsonSubmodelDescriptorSerializerTest.java | 2 +- .../aas4j/v3/dataformat/xml/serialization/KeySerializer.java | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java index fd5b0826c..b6a4dfa91 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java index ef6fdbfb8..fea84b439 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java index 0db3ae12a..296b11284 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java index a88291966..148c676f8 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java index 64f8d4a15..3e782f0d9 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java index 3fd5b8c4a..6a933ea5f 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java index 78d0f7df0..30db91945 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java index 5c9805de7..a5f2e3bbc 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java index 5915e8867..c71797477 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index fc6f2af60..1e24e44fb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 9a1e53ad1..c43e12769 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java index 28d7b36fe..bf213a4fb 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java index 89fdb5859..81bc2ca4e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java index de7108db1..fafbec74e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java index 44e10d707..c69de2381 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java index b036a0836..3b53fb72b 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java index b34f6e09e..ef75d513e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java index ae3360f42..86fbd42bb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java index 501ee11ce..36c6ffb26 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java index affda40f4..ca1a7c7e5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index 56d53fc33..e7a2458c9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index 5fc1f8e6e..0422c2e2d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index bd7e90a73..bef8fd2da 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 9ab226d17..74bfb8fa3 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java index febc36eb5..c744f9ff6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java index fd3587994..06324f3ce 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java index 37980a5b1..d449463fe 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index 7bc2b30ff..2bf14bbb4 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java index d8a61dfb2..f82b47696 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java index 8e545b727..44387a761 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 4dcdcdaf6f79ff58a09a4fbe2c0a69b9b7780aff Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 3 Jul 2023 16:29:52 +0200 Subject: [PATCH 16/91] Adapt the copyright notice --- .../aas4j/v3/dataformat/json/ReferableSerializer.java | 2 +- .../aas4j/v3/dataformat/json/ReferenceDeserializer.java | 2 +- .../v3/dataformat/json/ReflectionAnnotationIntrospector.java | 2 +- .../aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java | 2 +- .../v3/dataformat/json/SubmodelDescriptorDeserializer.java | 2 +- .../aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java | 2 +- .../json/mixins/AssetAdministrationShellDescriptorMixin.java | 2 +- .../json/mixins/DataSpecificationPhysicalUnitMixin.java | 2 +- .../aas4j/v3/dataformat/json/mixins/LangStringMixin.java | 2 +- .../v3/dataformat/json/mixins/SubmodelDescriptorMixin.java | 2 +- .../aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java | 2 +- .../aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java | 2 +- .../aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java | 2 +- .../aas4j/v3/dataformat/xml/SubmodelElementManager.java | 2 +- .../v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java | 2 +- .../xml/deserialization/LangStringNodeDeserializer.java | 2 +- .../dataformat/xml/deserialization/LangStringsDeserializer.java | 2 +- .../aas4j/v3/dataformat/xml/mixins/LangStringMixin.java | 2 +- .../v3/dataformat/xml/serialization/LangStringSerializer.java | 2 +- .../v3/dataformat/xml/serialization/LangStringsSerializer.java | 2 +- .../v3/dataformat/xml/serialization/ReferenceSerializer.java | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java index 41231cbfc..b3e6e375d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java index 99d877dd1..87725b376 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java index 53c94daf3..1fd77253c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java index 74c9145f3..e66d66791 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java index d87ad3a81..4f51d6d2a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java index 6f157e9f3..d1e7640db 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java index 38ccce841..4902bc2d5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 93528fee5..4d589447f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java index 3c135cfa4..ee87e0d54 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java index 20a22471d..5a874c713 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 95826b52d..2dc8b5891 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java index 60de90b26..4463d9a3a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java index 19c04a054..c07f20bf5 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java index b7e4b1287..de2b6cd89 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java index e2a29a42b..e1b22bc93 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java index 4e157a834..6c8bc20ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java index 7fb61b6a4..cb2dfaa88 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java index ebc3eb0c7..eaee8aa90 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java index 8bf691b20..ec348ca41 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java index 1ee6cc058..2e79f42db 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java index 2282408e6..0b75bb518 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java index 419a36ef7..7313d9a02 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 84711324c3091912f3f3d198b85a8be79b80523c Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 3 Jul 2023 16:39:24 +0200 Subject: [PATCH 17/91] add next iteration of generated part 1 classes --- ...ministrationShellElementWalkerVisitor.java | 4 +- ...ssetAdministrationShellElementVisitor.java | 3 - ...ministrationShellElementWalkerVisitor.java | 4 +- .../aas4j/v3/dataformat/core/AASFull.java | 52 +--- .../aas4j/v3/dataformat/core/AASSimple.java | 65 ++-- .../v3/dataformat/core/CustomProperty.java | 27 +- .../dataformat/core/EnumSerializerTest.java | 6 +- .../serialization/LangStringSerializer.java | 2 +- .../aas4j/v3/model/AasSubmodelElements.java | 38 +-- .../aas4j/v3/model/AbstractLangString.java | 2 +- .../v3/model/AdministrativeInformation.java | 66 +++- .../model/AnnotatedRelationshipElement.java | 10 +- .../v3/model/AssetAdministrationShell.java | 48 ++- .../aas4j/v3/model/AssetInformation.java | 83 +++-- .../digitaltwin/aas4j/v3/model/AssetKind.java | 19 +- .../aas4j/v3/model/BasicEventElement.java | 140 ++++----- .../digitaltwin/aas4j/v3/model/Blob.java | 40 +-- .../aas4j/v3/model/Capability.java | 2 +- .../aas4j/v3/model/ConceptDescription.java | 14 +- .../aas4j/v3/model/DataElement.java | 2 +- .../v3/model/DataSpecificationContent.java | 7 +- .../v3/model/DataSpecificationIec61360.java | 214 +++++++------ .../model/DataSpecificationPhysicalUnit.java | 293 ------------------ .../aas4j/v3/model/DataTypeDefXsd.java | 83 ++--- .../aas4j/v3/model/DataTypeIec61360.java | 42 +-- .../digitaltwin/aas4j/v3/model/Direction.java | 8 +- .../v3/model/EmbeddedDataSpecification.java | 18 +- .../digitaltwin/aas4j/v3/model/Entity.java | 74 ++--- .../aas4j/v3/model/EntityType.java | 8 +- .../aas4j/v3/model/Environment.java | 46 +-- .../aas4j/v3/model/EventElement.java | 2 +- .../aas4j/v3/model/EventPayload.java | 132 ++++---- .../digitaltwin/aas4j/v3/model/Extension.java | 55 ++-- .../digitaltwin/aas4j/v3/model/File.java | 40 +-- .../aas4j/v3/model/HasDataSpecification.java | 12 +- .../aas4j/v3/model/HasExtensions.java | 10 +- .../digitaltwin/aas4j/v3/model/HasKind.java | 17 +- .../aas4j/v3/model/HasSemantics.java | 16 +- .../aas4j/v3/model/Identifiable.java | 16 +- .../digitaltwin/aas4j/v3/model/Key.java | 16 +- .../digitaltwin/aas4j/v3/model/KeyTypes.java | 52 ++-- .../aas4j/v3/model/LangString.java | 33 -- .../LangStringDefinitionTypeIec61360.java | 2 +- .../aas4j/v3/model/LangStringNameType.java | 2 +- .../LangStringPreferredNameTypeIec61360.java | 2 +- .../LangStringShortNameTypeIec61360.java | 2 +- .../aas4j/v3/model/LangStringTextType.java | 2 +- .../digitaltwin/aas4j/v3/model/LevelType.java | 101 ++++-- .../aas4j/v3/model/ModelingKind.java | 41 --- .../aas4j/v3/model/MultiLanguageProperty.java | 22 +- .../digitaltwin/aas4j/v3/model/Operation.java | 54 ++-- .../aas4j/v3/model/OperationVariable.java | 10 +- .../digitaltwin/aas4j/v3/model/Property.java | 54 ++-- .../aas4j/v3/model/Qualifiable.java | 10 +- .../digitaltwin/aas4j/v3/model/Qualifier.java | 66 ++-- .../aas4j/v3/model/QualifierKind.java | 10 +- .../digitaltwin/aas4j/v3/model/Range.java | 46 +-- .../digitaltwin/aas4j/v3/model/Referable.java | 87 ++---- .../digitaltwin/aas4j/v3/model/Reference.java | 46 +-- .../aas4j/v3/model/ReferenceElement.java | 10 +- .../aas4j/v3/model/ReferenceTypes.java | 14 +- .../aas4j/v3/model/RelationshipElement.java | 16 +- .../digitaltwin/aas4j/v3/model/Resource.java | 40 +-- .../aas4j/v3/model/SpecificAssetId.java | 54 ++-- .../aas4j/v3/model/StateOfEvent.java | 8 +- .../digitaltwin/aas4j/v3/model/Submodel.java | 12 +- .../aas4j/v3/model/SubmodelElement.java | 10 +- .../v3/model/SubmodelElementCollection.java | 20 +- .../aas4j/v3/model/SubmodelElementList.java | 64 ++-- .../digitaltwin/aas4j/v3/model/ValueList.java | 10 +- .../aas4j/v3/model/ValueReferencePair.java | 20 +- .../aas4j/v3/model/annotations/IRI.java | 4 +- .../v3/model/annotations/KnownSubtypes.java | 4 +- .../v3/model/builder/AbstractBuilder.java | 4 +- .../AdministrativeInformationBuilder.java | 37 ++- .../AnnotatedRelationshipElementBuilder.java | 68 ++-- .../AssetAdministrationShellBuilder.java | 83 +++-- .../builder/AssetInformationBuilder.java | 42 ++- .../builder/BasicEventElementBuilder.java | 166 +++++----- .../aas4j/v3/model/builder/BlobBuilder.java | 124 +++----- .../aas4j/v3/model/builder/Builder.java | 4 +- .../v3/model/builder/CapabilityBuilder.java | 104 +++---- .../builder/ConceptDescriptionBuilder.java | 69 ++--- .../DataSpecificationIec61360Builder.java | 138 ++++----- .../DataSpecificationPhysicalUnitBuilder.java | 181 ----------- .../EmbeddedDataSpecificationBuilder.java | 4 +- .../aas4j/v3/model/builder/EntityBuilder.java | 157 +++++----- .../v3/model/builder/EnvironmentBuilder.java | 44 +-- .../v3/model/builder/EventPayloadBuilder.java | 64 ++-- .../v3/model/builder/ExtendableBuilder.java | 2 +- .../v3/model/builder/ExtensionBuilder.java | 35 ++- .../aas4j/v3/model/builder/FileBuilder.java | 124 +++----- .../aas4j/v3/model/builder/KeyBuilder.java | 2 +- .../v3/model/builder/LangStringBuilder.java | 54 ---- ...ngStringDefinitionTypeIec61360Builder.java | 2 +- .../builder/LangStringNameTypeBuilder.java | 2 +- ...tringPreferredNameTypeIec61360Builder.java | 2 +- ...angStringShortNameTypeIec61360Builder.java | 2 +- .../builder/LangStringTextTypeBuilder.java | 2 +- .../v3/model/builder/LevelTypeBuilder.java | 2 +- .../builder/MultiLanguagePropertyBuilder.java | 110 +++---- .../v3/model/builder/OperationBuilder.java | 148 ++++----- .../builder/OperationVariableBuilder.java | 2 +- .../v3/model/builder/PropertyBuilder.java | 126 ++++---- .../v3/model/builder/QualifierBuilder.java | 26 +- .../aas4j/v3/model/builder/RangeBuilder.java | 124 +++----- .../v3/model/builder/ReferenceBuilder.java | 44 +-- .../builder/ReferenceElementBuilder.java | 104 +++---- .../builder/RelationshipElementBuilder.java | 104 +++---- .../v3/model/builder/ResourceBuilder.java | 24 +- .../model/builder/SpecificAssetIdBuilder.java | 26 +- .../v3/model/builder/SubmodelBuilder.java | 145 ++++----- .../SubmodelElementCollectionBuilder.java | 111 +++---- .../builder/SubmodelElementListBuilder.java | 132 ++++---- .../v3/model/builder/ValueListBuilder.java | 2 +- .../builder/ValueReferencePairBuilder.java | 2 +- .../DefaultAdministrativeInformation.java | 71 ++++- .../DefaultAnnotatedRelationshipElement.java | 111 +++---- .../impl/DefaultAssetAdministrationShell.java | 106 +++---- .../model/impl/DefaultAssetInformation.java | 75 +++-- .../model/impl/DefaultBasicEventElement.java | 205 ++++++------ .../aas4j/v3/model/impl/DefaultBlob.java | 136 ++++---- .../v3/model/impl/DefaultCapability.java | 104 +++---- .../model/impl/DefaultConceptDescription.java | 82 +++-- .../DefaultDataSpecificationIec61360.java | 177 ++++++----- .../DefaultDataSpecificationPhysicalUnit.java | 268 ---------------- .../DefaultEmbeddedDataSpecification.java | 20 +- .../aas4j/v3/model/impl/DefaultEntity.java | 158 ++++------ .../v3/model/impl/DefaultEnvironment.java | 47 +-- .../v3/model/impl/DefaultEventPayload.java | 110 ++++--- .../aas4j/v3/model/impl/DefaultExtension.java | 58 ++-- .../aas4j/v3/model/impl/DefaultFile.java | 136 ++++---- .../aas4j/v3/model/impl/DefaultKey.java | 20 +- .../v3/model/impl/DefaultLangString.java | 113 ------- ...faultLangStringDefinitionTypeIec61360.java | 2 +- .../model/impl/DefaultLangStringNameType.java | 2 +- ...ltLangStringPreferredNameTypeIec61360.java | 2 +- ...efaultLangStringShortNameTypeIec61360.java | 2 +- .../model/impl/DefaultLangStringTextType.java | 2 +- .../aas4j/v3/model/impl/DefaultLevelType.java | 2 +- .../impl/DefaultMultiLanguageProperty.java | 116 +++---- .../aas4j/v3/model/impl/DefaultOperation.java | 141 ++++----- .../model/impl/DefaultOperationVariable.java | 13 +- .../aas4j/v3/model/impl/DefaultProperty.java | 143 ++++----- .../aas4j/v3/model/impl/DefaultQualifier.java | 58 ++-- .../aas4j/v3/model/impl/DefaultRange.java | 139 ++++----- .../aas4j/v3/model/impl/DefaultReference.java | 47 +-- .../model/impl/DefaultReferenceElement.java | 109 +++---- .../impl/DefaultRelationshipElement.java | 110 +++---- .../aas4j/v3/model/impl/DefaultResource.java | 44 +-- .../v3/model/impl/DefaultSpecificAssetId.java | 55 ++-- .../aas4j/v3/model/impl/DefaultSubmodel.java | 152 +++++---- .../DefaultSubmodelElementCollection.java | 116 +++---- .../impl/DefaultSubmodelElementList.java | 140 ++++----- .../aas4j/v3/model/impl/DefaultValueList.java | 13 +- .../model/impl/DefaultValueReferencePair.java | 20 +- 156 files changed, 3690 insertions(+), 5147 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index 90110b82c..2bcfd2d80 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -243,7 +243,7 @@ public default void visit(Entity entity) { if (entity == null) { return; } - visit(entity.getSpecificAssetId()); + entity.getSpecificAssetIds().forEach(x -> visit(x)); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -253,7 +253,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - visit(extension.getRefersTo()); + extension.getRefersTo().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index 298f531f2..4bff227da 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -226,9 +226,6 @@ public default void visit(SpecificAssetId identifierKeyValuePair) { public default void visit(Key key) { } - public default void visit(LangString langString) { - } - public default void visit(MultiLanguageProperty multiLanguageProperty) { } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index e4600c045..998826fee 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -214,7 +214,7 @@ public default void visit(Entity entity) { return; } //visit(entity.getGlobalAssetId()); - visit(entity.getSpecificAssetId()); + entity.getSpecificAssetIds().forEach(x -> visit(x)); entity.getStatements().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(entity); } @@ -224,7 +224,7 @@ public default void visit(Extension extension) { if (extension == null) { return; } - visit(extension.getRefersTo()); + extension.getRefersTo().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(extension); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 3fa4dc987..527b0f4c3 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -171,7 +171,7 @@ public static Submodel createSubmodel1() { .version("0.9") .revision("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -251,7 +251,7 @@ public static Submodel createSubmodel2() { .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -353,7 +353,7 @@ public static Submodel createSubmodel3() { .version("0.9") .revision("0") .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) @@ -451,7 +451,6 @@ public static Submodel createSubmodel3() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty3") .category("PARAMETER") .value("some example annotation") @@ -460,7 +459,6 @@ public static Submodel createSubmodel3() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -769,7 +767,7 @@ public static Submodel createSubmodel4() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel_Mandatory") .id("https://acplt.org/Test_Submodel_Mandatory") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .first(new DefaultReference.Builder() @@ -838,7 +836,6 @@ public static Submodel createSubmodel4() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultCapability.Builder() .idShort("ExampleCapability") @@ -906,7 +903,7 @@ public static Submodel createSubmodel4() { public static Submodel createSubmodel5() { return new DefaultSubmodel.Builder() .idShort("Test_Submodel2_Mandatory") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .id("https://acplt.org/Test_Submodel2_Mandatory") .build(); } @@ -919,7 +916,7 @@ public static Submodel createSubmodel6() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Missing") - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0").build()) @@ -1020,7 +1017,6 @@ public static Submodel createSubmodel6() { .type(ReferenceTypes.MODEL_REFERENCE) .build()) .annotations(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .idShort("ExampleProperty") .category("PARAMETER") .value("some example annotation") @@ -1029,7 +1025,6 @@ public static Submodel createSubmodel6() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -1324,7 +1319,7 @@ public static Submodel createSubmodel7() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-Teilmodell für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_Submodel_Template") - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() .version("0.9") .revision("0") @@ -1336,7 +1331,7 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) + .kind(ModellingKind.TEMPLATE) .submodelElements(new DefaultRelationshipElement.Builder() .idShort("ExampleRelationshipElement") .category("PARAMETER") @@ -1351,7 +1346,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1397,7 +1391,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .first(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1431,7 +1424,6 @@ public static Submodel createSubmodel7() { .build()) .submodelElements(new DefaultOperation.Builder() .idShort("ExampleOperation") - .kind(ModelingKind.TEMPLATE) .category("PARAMETER") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Example Operation object").language("en-us").build(), @@ -1444,7 +1436,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .inputVariables(new DefaultOperationVariable.Builder() .value(new DefaultProperty.Builder() .idShort("ExampleProperty") @@ -1460,7 +1451,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1480,7 +1470,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1500,7 +1489,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1520,7 +1508,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .submodelElements(new DefaultBasicEventElement.Builder() .idShort("ExampleBasicEvent") @@ -1538,7 +1525,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .observed(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL) @@ -1570,7 +1556,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .typeValueListElement(AasSubmodelElements.SUBMODEL_ELEMENT) .value(new DefaultProperty.Builder() .idShort("ExampleProperty") @@ -1586,7 +1571,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .valueType(DataTypeDefXsd.STRING) .build()) @@ -1604,7 +1588,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .value(new DefaultRange.Builder() .idShort("ExampleRange") @@ -1620,7 +1603,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min(null) .max("100") .valueType(DataTypeDefXsd.INT) @@ -1639,7 +1621,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .min("0") .max(null) .valueType(DataTypeDefXsd.INT) @@ -1659,7 +1640,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(new DefaultBlob.Builder() .idShort("ExampleBlob") .category("PARAMETER") @@ -1674,7 +1654,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .contentType("application/pdf") .build()) .value(new DefaultFile.Builder() @@ -1691,7 +1670,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .value(null) .contentType("application/pdf") .build()) @@ -1709,7 +1687,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build()) .submodelElements(new DefaultSubmodelElementCollection.Builder() @@ -1726,7 +1703,6 @@ public static Submodel createSubmodel7() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.TEMPLATE) .build()) .build(); } @@ -1800,14 +1776,14 @@ public static ConceptDescription createConceptDescription4() { .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() .preferredName(Arrays.asList( - new DefaultLangString.Builder().text("Test Specification").language("de").build(), - new DefaultLangString.Builder().text("TestSpecification").language("en-us").build() + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() )) .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangString.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangString.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangString.Builder().text("TestSpec").language("en-us").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) .unit("SpaceUnit") .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 2347000a1..158b8eb36 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -19,6 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import java.util.Arrays; + public class AASSimple { @@ -125,10 +127,10 @@ public static AssetAdministrationShell createAAS() { .name(EQUIPMENT_ID) .value(_538FD1B3_F99F_4A52_9C75_72E9FA921270) .externalSubjectId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() + .keys(Arrays.asList(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) .value(HTTP_CUSTOMER_COM_SYSTEMS_ERP_012) - .build()) + .build())) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .build()) @@ -184,11 +186,10 @@ public static Submodel createSubmodelTechnicalData() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_TECHNICAL_DATA_ID_SHORT) .id(SUBMODEL_TECHNICAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -206,11 +207,10 @@ public static Submodel createSubmodelTechnicalData() { public static Submodel createSubmodelOperationalData() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_OPERATIONAL_DATA_ID_SHORT) .id(SUBMODEL_OPERATIONAL_DATA_ID) .submodelElements(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -228,11 +228,10 @@ public static Submodel createSubmodelOperationalData() { public static Submodel createSubmodelDocumentation() { return new DefaultSubmodel.Builder() - .kind(ModelingKind.INSTANCE) + .kind(ModellingKind.INSTANCE) .idShort(SUBMODEL_DOCUMENTATION_ID_SHORT) .id(SUBMODEL_DOCUMENTATION_ID) .submodelElements(new DefaultSubmodelElementCollection.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -242,7 +241,6 @@ public static Submodel createSubmodelDocumentation() { .build()) .idShort(SUBMODEL_DOCUMENTATION_ELEMENTCOLLECTION_ID_SHORT) .value(new DefaultProperty.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -255,7 +253,6 @@ public static Submodel createSubmodelDocumentation() { .valueType(DataTypeDefXsd.STRING) .build()) .value(new DefaultFile.Builder() - .kind(ModelingKind.INSTANCE) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.CONCEPT_DESCRIPTION) @@ -286,14 +283,14 @@ public static ConceptDescription createConceptDescriptionTitle() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(TITLE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(TITEL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(TITEL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITLE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(TITEL).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.STRING_TRANSLATABLE) - .definition(new DefaultLangString.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(SPRACHABHÄNGIGER_TITELDES_DOKUMENTS).language("EN").build()) .build()) .build()) .build(); @@ -313,14 +310,14 @@ public static ConceptDescription createConceptDescriptionDigitalFile() { .build()) .dataSpecificationContent( new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .preferredName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITAL_FILE).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DIGITALE_DATEI).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITAL_FILE).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DIGITALE_DATEI).language("DE").build()) .unit("ExampleString") .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangString.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DIGITAL_FILE_DEFINITION).language("EN").build()) .build()) .build()) .build(); @@ -344,8 +341,8 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(MAX_DREHZAHL).language("de").build()) - .preferredName(new DefaultLangString.Builder().text(MAX_ROTATIONSPEED).language("en").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_DREHZAHL).language("de").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(MAX_ROTATIONSPEED).language("en").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -356,8 +353,8 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .build()) .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) - .definition(new DefaultLangString.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_DE).language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(MAX_ROTATE_DEF_EN).language("EN").build()) .build()) .build()) .build(); @@ -379,10 +376,10 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .build()) .dataSpecificationContent( new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .preferredName(new DefaultLangString.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) - .shortName(new DefaultLangString.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(ACTUALROTATIONSPEED).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(AKTUELLE_DREHZAHL).language("DE").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(ACTUAL_ROTATION_SPEED).language("EN").build()) .unit(_1_MIN) .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -393,8 +390,8 @@ public static ConceptDescription createConceptDescriptionRotationSpeed() { .build()) .sourceOfDefinition("ExampleString") .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangString.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) - .definition(new DefaultLangString.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(AKTUELLE_DREHZAHL_MITWELCHER_DER_MOTOR_ODER_DIE_SPEISEINHEIT_BETRIEBEN_WIRD).language("DE").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(ACTUAL_ROTATIONSPEED_WITH_WHICH_THE_MOTOR_OR_FEEDINGUNIT_IS_OPERATED).language("EN").build()) .build()) .build()) .build(); @@ -413,13 +410,13 @@ public static ConceptDescription createConceptDescriptionDocument() { .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOCUMENT).language("EN").build()) - .shortName(new DefaultLangString.Builder().text(DOKUMENT).language("DE").build()) + .preferredName(new DefaultLangStringPreferredNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOCUMENT).language("EN").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text(DOKUMENT).language("DE").build()) .unit("ExampleString") .sourceOfDefinition(ISO15519_1_2010) .dataType(DataTypeIec61360.STRING) - .definition(new DefaultLangString.Builder().text(DOCUMENT_DEF).language("EN").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text(DOCUMENT_DEF).language("EN").build()) .build()) .build()) .build(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 3178bad56..055ba67ba 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -28,8 +28,6 @@ public class CustomProperty implements Property { protected List dataSpecifications; - protected ModelingKind kind; - protected Reference semanticId; protected String value; @@ -58,7 +56,7 @@ protected CustomProperty() { @Override public int hashCode() { return Objects.hash(new Object[] { this.valueType, this.value, this.valueId, this.category, this.description, - this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications,*/ this.kind, + this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications, this.kind,*/ this.semanticId }); } @@ -78,7 +76,8 @@ public boolean equals(Object obj) { && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) - && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); + //&& Objects.equals(this.kind, other.kind) + && Objects.equals(this.semanticId, other.semanticId); } } @@ -132,16 +131,6 @@ final public void setDescription(List description) { this.description = description; } - @Override - public String getChecksum() { - return null; - } - - @Override - public void setChecksum(String checksum) { - - } - @Override final public List getDisplayName() { return displayName; @@ -182,16 +171,6 @@ final public void setEmbeddedDataSpecifications(List this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - final public ModelingKind getKind() { - return kind; - } - - @Override - final public void setKind(ModelingKind kind) { - this.kind = kind; - } - @Override final public Reference getSemanticId() { return semanticId; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 23ebcab8f..29a67e198 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -21,7 +21,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import org.junit.Assert; import org.junit.Before; @@ -82,8 +82,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { @Test public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { - assertSerialization(ModelingKind.INSTANCE, "Instance"); - assertSerialization(ModelingKind.TEMPLATE, "Template"); + assertSerialization(ModellingKind.INSTANCE, "Instance"); + assertSerialization(ModellingKind.TEMPLATE, "Template"); } private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java index 1ee6cc058..3c7f5e350 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java @@ -60,7 +60,7 @@ private void serializeLangString(ToXmlGenerator xgen, LangString langString) thr xgen.writeString(langString.getLanguage()); xgen.writeFieldName("text"); - xgen.writeString(langString.getText()); + xgen.writeString(langString.getValue()); xgen.writeEndObject(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index 897fab65f..311f54a79 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,87 +28,87 @@ public enum AasSubmodelElements { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Blob") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Capability") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/DataElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Entity") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Entity") ENTITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/EventElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/File") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/File") FILE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Operation") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Property") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Property") PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/Range") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/ReferenceElement") REFERENCE_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElement") SUBMODEL_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AasSubmodelElements/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/AasSubmodelElements/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index fe6b51a24..7689f9526 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index fc1808716..25e8457fd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,42 +29,80 @@ }) public interface AdministrativeInformation extends HasDataSpecification { + /** + * Version of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * + * @return Returns the String for the property version. + */ + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") + String getVersion(); + + /** + * Version of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/version + * + * @param version desired value for the property version. + */ + void setVersion(String version); + /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision * * @return Returns the String for the property revision. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") String getRevision(); /** * Revision of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/revision * * @param revision desired value for the property revision. */ void setRevision(String revision); /** - * Version of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @return Returns the String for the property version. + * @return Returns the Reference for the property creator. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") - String getVersion(); + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + Reference getCreator(); /** - * Version of the element. + * The subject ID of the subject responsible for making the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/creator * - * @param version desired value for the property version. + * @param creator desired value for the property creator. */ - void setVersion(String version); + void setCreator(Reference creator); + + /** + * Identifier of the template that guided the creation of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * + * @return Returns the String for the property templateId. + */ + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + String getTemplateId(); + + /** + * Identifier of the template that guided the creation of the element. + * + * More information under https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId + * + * @param templateId desired value for the property templateId. + */ + void setTemplateId(String templateId); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index b99fa839e..987cc7a15 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -35,20 +35,18 @@ public interface AnnotatedRelationshipElement extends RelationshipElement { * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations * * @return Returns the List of DataElements for the property annotations. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") List getAnnotations(); /** * A data element that represents an annotation that holds for the relationship between the two * elements * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations * * @param annotations desired value for the property annotations. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 05483cef1..2b51a7a67 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,59 +31,57 @@ public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @return Returns the AssetInformation for the property assetInformation. + * @return Returns the Reference for the property derivedFrom. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") - AssetInformation getAssetInformation(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") + Reference getDerivedFrom(); /** - * Meta-information about the asset the AAS is representing. + * The reference to the AAS the AAS was derived from. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom * - * @param assetInformation desired value for the property assetInformation. + * @param derivedFrom desired value for the property derivedFrom. */ - void setAssetInformation(AssetInformation assetInformation); + void setDerivedFrom(Reference derivedFrom); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @return Returns the Reference for the property derivedFrom. + * @return Returns the AssetInformation for the property assetInformation. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") - Reference getDerivedFrom(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") + AssetInformation getAssetInformation(); /** - * The reference to the AAS the AAS was derived from. + * Meta-information about the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation * - * @param derivedFrom desired value for the property derivedFrom. + * @param assetInformation desired value for the property assetInformation. */ - void setDerivedFrom(Reference derivedFrom); + void setAssetInformation(AssetInformation assetInformation); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels * * @return Returns the List of References for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") List getSubmodels(); /** * References to submodels of the AAS. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels * * @param submodels desired value for the property submodels. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 0664d8bed..61ce8f421 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,55 +34,36 @@ public interface AssetInformation { /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind * * @return Returns the AssetKind for the property assetKind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") AssetKind getAssetKind(); /** * Denotes whether the Asset is of kind 'Type' or 'Instance'. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetKind * * @param assetKind desired value for the property assetKind. */ void setAssetKind(AssetKind assetKind); - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail - * - * @return Returns the Resource for the property defaultThumbnail. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") - Resource getDefaultThumbnail(); - - /** - * Thumbnail of the asset represented by the Asset Administration Shell. - * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail - * - * @param defaultThumbnail desired value for the property defaultThumbnail. - */ - void setDefaultThumbnail(Resource defaultThumbnail); - /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * - * @return Returns the Reference for the property globalAssetId. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") String getGlobalAssetId(); /** * Global identifier of the asset the AAS is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId + * More information under https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ @@ -92,21 +73,61 @@ public interface AssetInformation { * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") List getSpecificAssetIds(); /** * Additional domain-specific, typically proprietary identifier for the asset like e.g., serial * number etc. * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds + * More information under https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds * * @param specificAssetIds desired value for the property specificAssetIds. */ void setSpecificAssetIds(List specificAssetIds); + /** + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * + * @return Returns the String for the property assetType. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + String getAssetType(); + + /** + * In case 'assetKind' is applicable the 'assetType' is the asset ID of the type asset of the asset + * under consideration as identified by 'globalAssetId'. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/assetType + * + * @param assetType desired value for the property assetType. + */ + void setAssetType(String assetType); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * + * @return Returns the Resource for the property defaultThumbnail. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") + Resource getDefaultThumbnail(); + + /** + * Thumbnail of the asset represented by the Asset Administration Shell. + * + * More information under https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail + * + * @param defaultThumbnail desired value for the property defaultThumbnail. + */ + void setDefaultThumbnail(Resource defaultThumbnail); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index a781efe26..80401d406 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,16 +27,21 @@ public enum AssetKind { /** - * concrete, clearly identifiable component of a certain type + * Instance asset */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Instance") + @IRI("https://admin-shell.io/aas/3/0/AssetKind/Instance") INSTANCE, /** - * hardware or software element which specifies the common attributes shared by all instances of the - * type + * Neither a type asset nor an instance asset + */ + @IRI("https://admin-shell.io/aas/3/0/AssetKind/NotApplicable") + NOT_APPLICABLE, + + /** + * Type asset */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetKind/Type") + @IRI("https://admin-shell.io/aas/3/0/AssetKind/Type") TYPE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index 9393d184c..b4544ceef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,73 +29,96 @@ }) public interface BasicEventElement extends EventElement { + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @return Returns the Reference for the property observed. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") + Reference getObserved(); + + /** + * Reference to the 'Referable', which defines the scope of the event. Can be + * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/observed + * + * @param observed desired value for the property observed. + */ + void setObserved(Reference observed); + /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction * * @return Returns the Direction for the property direction. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") Direction getDirection(); /** * Direction of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/direction * * @param direction desired value for the property direction. */ void setDirection(Direction direction); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @return Returns the String for the property lastUpdate. + * @return Returns the StateOfEvent for the property state. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") - String getLastUpdate(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") + StateOfEvent getState(); /** - * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). + * State of event. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/state * - * @param lastUpdate desired value for the property lastUpdate. + * @param state desired value for the property state. */ - void setLastUpdate(String lastUpdate); + void setState(StateOfEvent state); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @return Returns the String for the property maxInterval. + * @return Returns the String for the property messageTopic. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") - String getMaxInterval(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") + String getMessageTopic(); /** - * For input direction: not applicable. + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic * - * @param maxInterval desired value for the property maxInterval. + * @param messageTopic desired value for the property messageTopic. */ - void setMaxInterval(String maxInterval); + void setMessageTopic(String messageTopic); /** * Information, which outer message infrastructure shall handle messages for the 'EventElement'. * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker * * @return Returns the Reference for the property messageBroker. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") Reference getMessageBroker(); /** @@ -103,92 +126,69 @@ public interface BasicEventElement extends EventElement { * Refers to a 'Submodel', 'SubmodelElementList', 'SubmodelElementCollection' or 'Entity', which * contains 'DataElement''s describing the proprietary specification for the message broker. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker * * @param messageBroker desired value for the property messageBroker. */ void setMessageBroker(Reference messageBroker); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @return Returns the String for the property messageTopic. + * @return Returns the String for the property lastUpdate. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") - String getMessageTopic(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") + String getLastUpdate(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Timestamp in UTC, when the last event was received (input direction) or sent (output direction). * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate * - * @param messageTopic desired value for the property messageTopic. + * @param lastUpdate desired value for the property lastUpdate. */ - void setMessageTopic(String messageTopic); + void setLastUpdate(String lastUpdate); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval * * @return Returns the String for the property minInterval. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") String getMinInterval(); /** * For input direction, reports on the maximum frequency, the software entity behind the respective * Referable can handle input events. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/minInterval * * @param minInterval desired value for the property minInterval. */ void setMinInterval(String minInterval); /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed - * - * @return Returns the Reference for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") - Reference getObserved(); - - /** - * Reference to the 'Referable', which defines the scope of the event. Can be - * 'AssetAdministrationShell', 'Submodel', or 'SubmodelElement'. - * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed - * - * @param observed desired value for the property observed. - */ - void setObserved(Reference observed); - - /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @return Returns the StateOfEvent for the property state. + * @return Returns the String for the property maxInterval. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") - StateOfEvent getState(); + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") + String getMaxInterval(); /** - * State of event. + * For input direction: not applicable. * - * More information under https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state + * More information under https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval * - * @param state desired value for the property state. + * @param maxInterval desired value for the property maxInterval. */ - void setState(StateOfEvent state); + void setMaxInterval(String maxInterval); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 597dfcb1f..1edb58bed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Blob extends DataElement { /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @return Returns the String for the property contentType. + * @return Returns the byte[] for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Blob/value") + byte[] getValue(); /** - * Content type of the content of the 'Blob'. + * The value of the 'Blob' instance of a blob data element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/contentType + * More information under https://admin-shell.io/aas/3/0/Blob/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(byte[] value); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @return Returns the byte[] for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") - byte[] getValue(); + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") + String getContentType(); /** - * The value of the 'Blob' instance of a blob data element. + * Content type of the content of the 'Blob'. * - * More information under https://admin-shell.io/aas/3/0/RC02/Blob/value + * More information under https://admin-shell.io/aas/3/0/Blob/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(byte[] value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java index de73e72cf..0dc242c2f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index 483e61428..724d31fed 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,20 +34,20 @@ public interface ConceptDescription extends HasDataSpecification, Identifiable { /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * * @return Returns the List of References for the property isCaseOf. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") List getIsCaseOf(); /** * Reference to an external definition the concept is compatible to or was derived from. * - * More information under https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf + * More information under https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf * - * @param isCaseOf desired value for the property isCaseOf. + * @param isCaseOfs desired value for the property isCaseOf. */ - void setIsCaseOf(List isCaseOf); + void setIsCaseOf(List isCaseOfs); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index 4b2208252..628d658af 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 2a5a59ae6..e2933c187 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,8 +26,7 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class), - @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) + @KnownSubtypes.Type(value = DataSpecificationIec61360.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 1ab999fd6..182a70102 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,118 +32,97 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType - * - * @return Returns the DataTypeIec61360 for the property dataType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") - DataTypeIec61360 getDataType(); - - /** - * Data Type - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType - * - * @param dataType desired value for the property dataType. - */ - void setDataType(DataTypeIec61360 dataType); - - /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @return Returns the List of LangStrings for the property definition. + * @return Returns the List of LangStringPreferredNameTypeIec61360s for the property preferredName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") - List getDefinition(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + List getPreferredName(); /** - * Definition in different languages + * Preferred name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName * - * @param definition desired value for the property definition. + * @param preferredNames desired value for the property preferredName. */ - void setDefinition(List definition); + void setPreferredName(List preferredNames); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @return Returns the LevelType for the property levelType. + * @return Returns the List of LangStringShortNameTypeIec61360s for the property shortName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") - LevelType getLevelType(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + List getShortName(); /** - * Set of levels. + * Short name * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName * - * @param levelType desired value for the property levelType. + * @param shortNames desired value for the property shortName. */ - void setLevelType(LevelType levelType); + void setShortName(List shortNames); /** - * Preferred name + * Unit * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @return Returns the List of LangStrings for the property preferredName. + * @return Returns the String for the property unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") - List getPreferredName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") + String getUnit(); /** - * Preferred name + * Unit * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit * - * @param preferredName desired value for the property preferredName. + * @param unit desired value for the property unit. */ - void setPreferredName(List preferredName); + void setUnit(String unit); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @return Returns the List of LangStrings for the property shortName. + * @return Returns the Reference for the property unitId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") - List getShortName(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") + Reference getUnitId(); /** - * Short name + * Unique unit id * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId * - * @param shortName desired value for the property shortName. + * @param unitId desired value for the property unitId. */ - void setShortName(List shortName); + void setUnitId(Reference unitId); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition * * @return Returns the String for the property sourceOfDefinition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") String getSourceOfDefinition(); /** * Source of definition * * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition + * https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition * * @param sourceOfDefinition desired value for the property sourceOfDefinition. */ @@ -152,93 +131,74 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol * * @return Returns the String for the property symbol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") String getSymbol(); /** * Symbol * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol * * @param symbol desired value for the property symbol. */ void setSymbol(String symbol); /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit - * - * @return Returns the String for the property unit. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") - String getUnit(); - - /** - * Unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit - * - * @param unit desired value for the property unit. - */ - void setUnit(String unit); - - /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @return Returns the Reference for the property unitId. + * @return Returns the DataTypeIec61360 for the property dataType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") - Reference getUnitId(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") + DataTypeIec61360 getDataType(); /** - * Unique unit id + * Data Type * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType * - * @param unitId desired value for the property unitId. + * @param dataType desired value for the property dataType. */ - void setUnitId(Reference unitId); + void setDataType(DataTypeIec61360 dataType); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @return Returns the String for the property value. + * @return Returns the List of LangStringDefinitionTypeIec61360s for the property definition. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + List getDefinition(); /** - * Value + * Definition in different languages * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition * - * @param value desired value for the property value. + * @param definitions desired value for the property definition. */ - void setValue(String value); + void setDefinition(List definitions); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat * * @return Returns the String for the property valueFormat. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") String getValueFormat(); /** * Value Format * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat * * @param valueFormat desired value for the property valueFormat. */ @@ -247,20 +207,58 @@ public interface DataSpecificationIec61360 extends DataSpecificationContent { /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList * * @return Returns the ValueList for the property valueList. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") ValueList getValueList(); /** * List of allowed values * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList * * @param valueList desired value for the property valueList. */ void setValueList(ValueList valueList); + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") + String getValue(); + + /** + * Value + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @return Returns the LevelType for the property levelType. + */ + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") + LevelType getLevelType(); + + /** + * Set of levels. + * + * More information under https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType + * + * @param levelType desired value for the property levelType. + */ + void setLevelType(LevelType levelType); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java deleted file mode 100644 index dc48bc871..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) -}) -public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { - - /** - * Conversion factor - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor - * - * @return Returns the String for the property conversionFactor. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - String getConversionFactor(); - - /** - * Conversion factor - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor - * - * @param conversionFactor desired value for the property conversionFactor. - */ - void setConversionFactor(String conversionFactor); - - /** - * Definition in different languages - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition - * - * @return Returns the List of LangStrings for the property definition. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") - List getDefinition(); - - /** - * Definition in different languages - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition - * - * @param definition desired value for the property definition. - */ - void setDefinition(List definition); - - /** - * Notation of physical unit conformant to DIN - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation - * - * @return Returns the String for the property dinNotation. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - String getDinNotation(); - - /** - * Notation of physical unit conformant to DIN - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation - * - * @param dinNotation desired value for the property dinNotation. - */ - void setDinNotation(String dinNotation); - - /** - * Code of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode - * - * @return Returns the String for the property eceCode. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - String getEceCode(); - - /** - * Code of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode - * - * @param eceCode desired value for the property eceCode. - */ - void setEceCode(String eceCode); - - /** - * Name of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName - * - * @return Returns the String for the property eceName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - String getEceName(); - - /** - * Name of physical unit conformant to ECE - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName - * - * @param eceName desired value for the property eceName. - */ - void setEceName(String eceName); - - /** - * Name of NIST physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName - * - * @return Returns the String for the property nistName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - String getNistName(); - - /** - * Name of NIST physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName - * - * @param nistName desired value for the property nistName. - */ - void setNistName(String nistName); - - /** - * Registration authority ID - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId - * - * @return Returns the String for the property registrationAuthorityId. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - String getRegistrationAuthorityId(); - - /** - * Registration authority ID - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId - * - * @param registrationAuthorityId desired value for the property registrationAuthorityId. - */ - void setRegistrationAuthorityId(String registrationAuthorityId); - - /** - * Name of SI physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName - * - * @return Returns the String for the property siName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") - String getSiName(); - - /** - * Name of SI physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName - * - * @param siName desired value for the property siName. - */ - void setSiName(String siName); - - /** - * Notation of SI physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation - * - * @return Returns the String for the property siNotation. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - String getSiNotation(); - - /** - * Notation of SI physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation - * - * @param siNotation desired value for the property siNotation. - */ - void setSiNotation(String siNotation); - - /** - * Source of definition - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition - * - * @return Returns the String for the property sourceOfDefinition. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") - String getSourceOfDefinition(); - - /** - * Source of definition - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition - * - * @param sourceOfDefinition desired value for the property sourceOfDefinition. - */ - void setSourceOfDefinition(String sourceOfDefinition); - - /** - * Supplier - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier - * - * @return Returns the String for the property supplier. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - String getSupplier(); - - /** - * Supplier - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier - * - * @param supplier desired value for the property supplier. - */ - void setSupplier(String supplier); - - /** - * Name of the physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName - * - * @return Returns the String for the property unitName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - String getUnitName(); - - /** - * Name of the physical unit - * - * More information under https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName - * - * @param unitName desired value for the property unitName. - */ - void setUnitName(String unitName); - - /** - * Symbol for the physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol - * - * @return Returns the String for the property unitSymbol. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - String getUnitSymbol(); - - /** - * Symbol for the physical unit - * - * More information under - * https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol - * - * @param unitSymbol desired value for the property unitSymbol. - */ - void setUnitSymbol(String unitSymbol); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java index 0b375631d..cb41effbd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,174 +21,159 @@ /** - * Enumeration listing all xsd anySimpleTypes + * Enumeration listing all XSD anySimpleTypes */ @IRI("aas:DataTypeDefXsd") public enum DataTypeDefXsd { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/AnyUri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/AnyUri") ANY_URI, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Base64Binary") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Base64Binary") BASE64BINARY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Boolean") BOOLEAN, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Byte") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Byte") BYTE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Date") DATE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTime") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/DateTime") DATE_TIME, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DateTimeStamp") - DATE_TIME_STAMP, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/DayTimeDuration") - DAY_TIME_DURATION, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Decimal") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Decimal") DECIMAL, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Double") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Double") DOUBLE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Duration") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Duration") DURATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Float") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Float") FLOAT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GDay") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GDay") GDAY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonth") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GMonth") GMONTH, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GMonthDay") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GMonthDay") GMONTH_DAY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYear") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GYear") GYEAR, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/GYearMonth") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/GYearMonth") GYEAR_MONTH, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/HexBinary") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/HexBinary") HEX_BINARY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Int") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Int") INT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Integer") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Integer") INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Long") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Long") LONG, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NegativeInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NegativeInteger") NEGATIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonNegativeInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NonNegativeInteger") NON_NEGATIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/NonPositiveInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/NonPositiveInteger") NON_POSITIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/PositiveInteger") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/PositiveInteger") POSITIVE_INTEGER, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Short") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Short") SHORT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/String") STRING, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/Time") TIME, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedByte") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedByte") UNSIGNED_BYTE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedInt") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedInt") UNSIGNED_INT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedLong") + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedLong") UNSIGNED_LONG, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/UnsignedShort") - UNSIGNED_SHORT, - - /** - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeDefXsd/YearMonthDuration") - YEAR_MONTH_DURATION; + @IRI("https://admin-shell.io/aas/3/0/DataTypeDefXsd/UnsignedShort") + UNSIGNED_SHORT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index fd884386a..d0ddfa144 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,123 +28,123 @@ public enum DataTypeIec61360 { /** * values containing the content of a file. Values may be binaries. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Blob") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Blob") BLOB, /** * values representing truth of logic or Boolean algebra (TRUE, FALSE) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Boolean") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Boolean") BOOLEAN, /** * values containing a calendar date, conformant to ISO 8601:2004 Format yyyy-mm-dd Example from IEC * 61360-1:2017: "1999-05-31" is the [DATE] representation of: "31 May 1999". */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Date") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Date") DATE, /** * values containing an address to a file. The values are of type URI and can represent an absolute * or relative path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/File") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/File") FILE, /** * Values containing string with any sequence of characters, using the syntax of HTML5 (see W3C * Recommendation 28:2014) */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Html") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Html") HTML, /** * values containing values of type INTEGER but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCount") INTEGER_COUNT, /** * values containing values of type INTEGER that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerCurrency") INTEGER_CURRENCY, /** * values containing values that are measure of type INTEGER. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/IntegerMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/IntegerMeasure") INTEGER_MEASURE, /** * values conforming to ISO/IEC 11179 series global identifier sequences */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Irdi") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Irdi") IRDI, /** * values containing values of type STRING conformant to Rfc 3987 */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Iri") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Iri") IRI, /** * values containing values of type rational */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Rational") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Rational") RATIONAL, /** * values containing values of type rational. In addition such a value comes with a physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RationalMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RationalMeasure") RATIONAL_MEASURE, /** * values containing numbers that can be written as a terminating or non-terminating decimal; a * rational or irrational number but are no currencies or measures */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCount") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCount") REAL_COUNT, /** * values containing values of type REAL that are currencies */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealCurrency") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealCurrency") REAL_CURRENCY, /** * values containing values that are measures of type REAL. In addition such a value comes with a * physical unit. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/RealMeasure") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/RealMeasure") REAL_MEASURE, /** * values consisting of sequence of characters but cannot be translated into other languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/String") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/String") STRING, /** * values containing string but shall be represented as different string in different languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/StringTranslatable") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/StringTranslatable") STRING_TRANSLATABLE, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Time") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Time") TIME, /** * values containing a time, conformant to ISO 8601:2004 but restricted to what is allowed in the * corresponding type in xml. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/DataTypeIec61360/Timestamp") + @IRI("https://admin-shell.io/aas/3/0/DataTypeIec61360/Timestamp") TIMESTAMP; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index 0f510b76a..dcc154a6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum Direction { /** * Input direction. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Input") + @IRI("https://admin-shell.io/aas/3/0/Direction/Input") INPUT, /** * Output direction */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Direction/Output") + @IRI("https://admin-shell.io/aas/3/0/Direction/Output") OUTPUT; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index 67673ab64..48c3a2ccb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,19 +32,17 @@ public interface EmbeddedDataSpecification { /** * Reference to the data specification * - * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification + * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification * * @return Returns the Reference for the property dataSpecification. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") Reference getDataSpecification(); /** * Reference to the data specification * - * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification + * More information under https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification * * @param dataSpecification desired value for the property dataSpecification. */ @@ -54,18 +52,18 @@ public interface EmbeddedDataSpecification { * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent * * @return Returns the DataSpecificationContent for the property dataSpecificationContent. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") DataSpecificationContent getDataSpecificationContent(); /** * Actual content of the data specification * * More information under - * https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent + * https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent * * @param dataSpecificationContent desired value for the property dataSpecificationContent. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index 77ca80168..c29c453e2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,20 +30,41 @@ }) public interface Entity extends SubmodelElement { + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @return Returns the List of SubmodelElements for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") + List getStatements(); + + /** + * Describes statements applicable to the entity by a set of submodel elements, typically with a + * qualified value. + * + * More information under https://admin-shell.io/aas/3/0/Entity/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); + /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/Entity/entityType * * @return Returns the EntityType for the property entityType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") EntityType getEntityType(); /** * Describes whether the entity is a co-managed entity or a self-managed entity. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/entityType + * More information under https://admin-shell.io/aas/3/0/Entity/entityType * * @param entityType desired value for the property entityType. */ @@ -52,17 +73,17 @@ public interface Entity extends SubmodelElement { /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * - * @return Returns the Reference for the property globalAssetId. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") String getGlobalAssetId(); /** * Global identifier of the asset the entity is representing. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ @@ -72,42 +93,21 @@ public interface Entity extends SubmodelElement { * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @return Returns the SpecificAssetId for the property specificAssetId. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - SpecificAssetId getSpecificAssetId(); + @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") + List getSpecificAssetIds(); /** * Reference to a specific asset ID representing a supplementary identifier of the asset represented * by the Asset Administration Shell. * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId + * More information under https://admin-shell.io/aas/3/0/Entity/specificAssetIds * - * @param specificAssetId desired value for the property specificAssetId. + * @param specificAssetIds desired value for the property specificAssetIds. */ - void setSpecificAssetId(SpecificAssetId specificAssetId); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements - * - * @return Returns the List of SubmodelElements for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") - List getStatements(); - - /** - * Describes statements applicable to the entity by a set of submodel elements, typically with a - * qualified value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Entity/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); + void setSpecificAssetIds(List specificAssetIds); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 137e66dde..233102815 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,14 +30,14 @@ public enum EntityType { * For co-managed entities there is no separate AAS. Co-managed entities need to be part of a * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/CoManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/EntityType/CoManagedEntity") CO_MANAGED_ENTITY, /** * Self-Managed Entities have their own AAS but can be part of the bill of material of a composite * self-managed entity. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EntityType/SelfManagedEntity") + @IRI("https://admin-shell.io/aas/3/0/EntityType/SelfManagedEntity") SELF_MANAGED_ENTITY; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index 5ea7ac571..e41524972 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,58 +33,58 @@ public interface Environment { /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells * * @return Returns the List of AssetAdministrationShells for the property assetAdministrationShells. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") List getAssetAdministrationShells(); /** * Asset administration shell * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells + * More information under https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells * * @param assetAdministrationShells desired value for the property assetAdministrationShells. */ void setAssetAdministrationShells(List assetAdministrationShells); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. + * @return Returns the List of Submodels for the property submodels. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") - List getConceptDescriptions(); + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") + List getSubmodels(); /** - * Concept description + * Submodel * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions + * More information under https://admin-shell.io/aas/3/0/Environment/submodels * - * @param conceptDescriptions desired value for the property conceptDescriptions. + * @param submodels desired value for the property submodels. */ - void setConceptDescriptions(List conceptDescriptions); + void setSubmodels(List submodels); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @return Returns the List of Submodels for the property submodels. + * @return Returns the List of ConceptDescriptions for the property conceptDescriptions. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") - List getSubmodels(); + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") + List getConceptDescriptions(); /** - * Submodel + * Concept description * - * More information under https://admin-shell.io/aas/3/0/RC02/Environment/submodels + * More information under https://admin-shell.io/aas/3/0/Environment/conceptDescriptions * - * @param submodels desired value for the property submodels. + * @param conceptDescriptions desired value for the property conceptDescriptions. */ - void setSubmodels(List submodels); + void setConceptDescriptions(List conceptDescriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java index 074938c82..a134a0289 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index ab5677f03..42720b37c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,116 +30,118 @@ public interface EventPayload { /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @return Returns the Reference for the property observableReference. + * @return Returns the Reference for the property source. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") - Reference getObservableReference(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") + Reference getSource(); /** - * Reference to the referable, which defines the scope of the event. + * Reference to the source event element, including identification of 'AssetAdministrationShell', + * 'Submodel', 'SubmodelElement''s. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference + * More information under https://admin-shell.io/aas/3/0/EventPayload/source * - * @param observableReference desired value for the property observableReference. + * @param source desired value for the property source. */ - void setObservableReference(Reference observableReference); + void setSource(Reference source); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @return Returns the Reference for the property observableSemanticId. + * @return Returns the Reference for the property sourceSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") - Reference getObservableSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") + Reference getSourceSemanticId(); /** - * 'semanticId' of the referable which defines the scope of the event, if available. + * 'semanticId' of the source event element, if available * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId * - * @param observableSemanticId desired value for the property observableSemanticId. + * @param sourceSemanticId desired value for the property sourceSemanticId. */ - void setObservableSemanticId(Reference observableSemanticId); + void setSourceSemanticId(Reference sourceSemanticId); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @return Returns the String for the property payload. + * @return Returns the Reference for the property observableReference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") - String getPayload(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") + Reference getObservableReference(); /** - * Event specific payload. + * Reference to the referable, which defines the scope of the event. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/payload + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableReference * - * @param payload desired value for the property payload. + * @param observableReference desired value for the property observableReference. */ - void setPayload(String payload); + void setObservableReference(Reference observableReference); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @return Returns the Reference for the property source. + * @return Returns the Reference for the property observableSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") - Reference getSource(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") + Reference getObservableSemanticId(); /** - * Reference to the source event element, including identification of 'AssetAdministrationShell', - * 'Submodel', 'SubmodelElement''s. + * 'semanticId' of the referable which defines the scope of the event, if available. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/source + * More information under https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId * - * @param source desired value for the property source. + * @param observableSemanticId desired value for the property observableSemanticId. */ - void setSource(Reference source); + void setObservableSemanticId(Reference observableSemanticId); /** - * 'semanticId' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @return Returns the Reference for the property sourceSemanticId. + * @return Returns the String for the property topic. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") - Reference getSourceSemanticId(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") + String getTopic(); /** - * 'semanticId' of the source event element, if available + * Information for the outer message infrastructure for scheduling the event to the respective + * communication channel. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId + * More information under https://admin-shell.io/aas/3/0/EventPayload/topic * - * @param sourceSemanticId desired value for the property sourceSemanticId. + * @param topic desired value for the property topic. */ - void setSourceSemanticId(Reference sourceSemanticId); + void setTopic(String topic); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * * @return Returns the Reference for the property subjectId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") Reference getSubjectId(); /** * Subject, who/which initiated the creation. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId + * More information under https://admin-shell.io/aas/3/0/EventPayload/subjectId * * @param subjectId desired value for the property subjectId. */ @@ -148,41 +150,39 @@ public interface EventPayload { /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp * * @return Returns the String for the property timeStamp. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") String getTimeStamp(); /** * Timestamp in UTC, when this event was triggered. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp + * More information under https://admin-shell.io/aas/3/0/EventPayload/timeStamp * * @param timeStamp desired value for the property timeStamp. */ void setTimeStamp(String timeStamp); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @return Returns the String for the property topic. + * @return Returns the byte[] for the property payload. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") - String getTopic(); + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + byte[] getPayload(); /** - * Information for the outer message infrastructure for scheduling the event to the respective - * communication channel. + * Event specific payload. * - * More information under https://admin-shell.io/aas/3/0/RC02/EventPayload/topic + * More information under https://admin-shell.io/aas/3/0/EventPayload/payload * - * @param topic desired value for the property topic. + * @param payload desired value for the property payload. */ - void setTopic(String topic); + void setPayload(byte[] payload); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index e8a30fcda..c3c5f2659 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,11 +15,12 @@ package org.eclipse.digitaltwin.aas4j.v3.model; - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; +import java.util.List; + /** * Single extension of an element. @@ -32,77 +33,77 @@ public interface Extension extends HasSemantics { /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name + * More information under https://admin-shell.io/aas/3/0/Extension/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/Extension/name") String getName(); /** * Name of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/name + * More information under https://admin-shell.io/aas/3/0/Extension/name * * @param name desired value for the property name. */ void setName(String name); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @return Returns the Reference for the property refersTo. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - Reference getRefersTo(); + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") + DataTypeDefXsd getValueType(); /** - * Reference to an element the extension refers to. + * Type of the value of the extension. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/refersTo + * More information under https://admin-shell.io/aas/3/0/Extension/valueType * - * @param refersTo desired value for the property refersTo. + * @param valueType desired value for the property valueType. */ - void setRefersTo(Reference refersTo); + void setValueType(DataTypeDefXsd valueType); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value + * More information under https://admin-shell.io/aas/3/0/Extension/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/Extension/value") String getValue(); /** * Value of the extension * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/value + * More information under https://admin-shell.io/aas/3/0/Extension/value * * @param value desired value for the property value. */ void setValue(String value); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the List of References for the property refersTo. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + List getRefersTo(); /** - * Type of the value of the extension. + * Reference to an element the extension refers to. * - * More information under https://admin-shell.io/aas/3/0/RC02/Extension/valueType + * More information under https://admin-shell.io/aas/3/0/Extension/refersTo * - * @param valueType desired value for the property valueType. + * @param refersTos desired value for the property refersTo. */ - void setValueType(DataTypeDefXsd valueType); + void setRefersTo(List refersTos); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index b4a55cd82..ed40d2d1e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,41 +30,41 @@ public interface File extends DataElement { /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @return Returns the String for the property contentType. + * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/File/value") + String getValue(); /** - * Content type of the content of the file. + * Path and name of the referenced file (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/File/contentType + * More information under https://admin-shell.io/aas/3/0/File/value * - * @param contentType desired value for the property contentType. + * @param value desired value for the property value. */ - void setContentType(String contentType); + void setValue(String value); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @return Returns the String for the property value. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") - String getValue(); + @IRI("https://admin-shell.io/aas/3/0/File/contentType") + String getContentType(); /** - * Path and name of the referenced file (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/File/value + * More information under https://admin-shell.io/aas/3/0/File/contentType * - * @param value desired value for the property value. + * @param contentType desired value for the property contentType. */ - void setValue(String value); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index e4c2c5f05..5887c38e5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -27,8 +27,8 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = ConceptDescription.class), + @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasDataSpecification { @@ -37,19 +37,19 @@ public interface HasDataSpecification { * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications * * @return Returns the List of EmbeddedDataSpecifications for the property * embeddedDataSpecifications. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") List getEmbeddedDataSpecifications(); /** * Embedded data specification. * * More information under - * https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications + * https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications * * @param embeddedDataSpecifications desired value for the property embeddedDataSpecifications. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 13fb36c83..761b5baca 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface HasExtensions { /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions * * @return Returns the List of Extensions for the property extensions. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") List getExtensions(); /** * An extension of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions + * More information under https://admin-shell.io/aas/3/0/HasExtensions/extensions * * @param extensions desired value for the property extensions. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 442566120..452c60ee1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,7 +25,6 @@ * An element with a kind is an element that can either represent a template or an instance. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) public interface HasKind { @@ -33,20 +32,20 @@ public interface HasKind { /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/HasKind/kind * - * @return Returns the ModelingKind for the property kind. + * @return Returns the ModellingKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - ModelingKind getKind(); + @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") + ModellingKind getKind(); /** * Kind of the element: either type or instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasKind/kind + * More information under https://admin-shell.io/aas/3/0/HasKind/kind * * @param kind desired value for the property kind. */ - void setKind(ModelingKind kind); + void setKind(ModellingKind kind); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index b3ad0078e..41f9b9978 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,18 +37,18 @@ public interface HasSemantics { * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") Reference getSemanticId(); /** * Identifier of the semantic definition of the element. It is called semantic ID of the element or * also main semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId + * More information under https://admin-shell.io/aas/3/0/HasSemantics/semanticId * * @param semanticId desired value for the property semanticId. */ @@ -58,18 +58,18 @@ public interface HasSemantics { * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds * * @return Returns the List of References for the property supplementalSemanticIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") List getSupplementalSemanticIds(); /** * Identifier of a supplemental semantic definition of the element. It is called supplemental * semantic ID of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds + * More information under https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds * * @param supplementalSemanticIds desired value for the property supplementalSemanticIds. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index f48661fd5..6cf22f3bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface Identifiable extends Referable { /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/Identifiable/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") AdministrativeInformation getAdministration(); /** * Administrative information of an identifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/administration + * More information under https://admin-shell.io/aas/3/0/Identifiable/administration * * @param administration desired value for the property administration. */ @@ -53,17 +53,17 @@ public interface Identifiable extends Referable { /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/Identifiable/id * * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") String getId(); /** * The globally unique identification of the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Identifiable/id + * More information under https://admin-shell.io/aas/3/0/Identifiable/id * * @param id desired value for the property id. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index 80ead008c..f91b08a96 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,17 +32,17 @@ public interface Key { /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/type + * More information under https://admin-shell.io/aas/3/0/Key/type * * @return Returns the KeyTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") + @IRI("https://admin-shell.io/aas/3/0/Key/type") KeyTypes getType(); /** * Denotes which kind of entity is referenced. * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/type + * More information under https://admin-shell.io/aas/3/0/Key/type * * @param type desired value for the property type. */ @@ -51,17 +51,17 @@ public interface Key { /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/value + * More information under https://admin-shell.io/aas/3/0/Key/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") + @IRI("https://admin-shell.io/aas/3/0/Key/value") String getValue(); /** * The key value, for example an IRDI or an URI * - * More information under https://admin-shell.io/aas/3/0/RC02/Key/value + * More information under https://admin-shell.io/aas/3/0/Key/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index 5e6cec41e..84d18f137 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,133 +28,133 @@ public enum KeyTypes { /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AnnotatedRelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AnnotatedRelationshipElement") ANNOTATED_RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/AssetAdministrationShell") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/AssetAdministrationShell") ASSET_ADMINISTRATION_SHELL, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/BasicEventElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/BasicEventElement") BASIC_EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Blob") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Blob") BLOB, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Capability") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Capability") CAPABILITY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ConceptDescription") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ConceptDescription") CONCEPT_DESCRIPTION, /** * Data element. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/DataElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/DataElement") DATA_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Entity") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Entity") ENTITY, /** * Event. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/EventElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/EventElement") EVENT_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/File") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/File") FILE, /** * Bookmark or a similar local identifier of a subordinate part of a primary resource */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/FragmentReference") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/FragmentReference") FRAGMENT_REFERENCE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/GlobalReference") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/GlobalReference") GLOBAL_REFERENCE, /** * Identifiable. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Identifiable") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Identifiable") IDENTIFIABLE, /** * Property with a value that can be provided in multiple languages */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/MultiLanguageProperty") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/MultiLanguageProperty") MULTI_LANGUAGE_PROPERTY, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Operation") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Operation") OPERATION, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Property") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Property") PROPERTY, /** * Range with min and max */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Range") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Range") RANGE, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Referable") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Referable") REFERABLE, /** * Reference */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/ReferenceElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/ReferenceElement") REFERENCE_ELEMENT, /** * Relationship */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/RelationshipElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/RelationshipElement") RELATIONSHIP_ELEMENT, /** */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/Submodel") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/Submodel") SUBMODEL, /** * Submodel Element */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElement") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElement") SUBMODEL_ELEMENT, /** * Struct of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementCollection") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementCollection") SUBMODEL_ELEMENT_COLLECTION, /** * List of Submodel Elements */ - @IRI("https://admin-shell.io/aas/3/0/RC02/KeyTypes/SubmodelElementList") + @IRI("https://admin-shell.io/aas/3/0/KeyTypes/SubmodelElementList") SUBMODEL_ELEMENT_LIST; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java deleted file mode 100644 index 9d374c663..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.io.Serializable; - - -@IRI("rdf:langString") -public interface LangString extends Serializable { - - public String getLanguage(); - - public void setLanguage(String language); - - public String getText(); - - public void setText(String text); -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java index 0e53dde47..fb49700bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java index c28a05bbb..1fe4604ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java index 12de5f4d9..e03afda72 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java index fecf969e6..98fcdaf14 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java index 2fffe3cd8..2ff44c065 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index 51b946890..4f3931d96 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -16,37 +16,94 @@ package org.eclipse.digitaltwin.aas4j.v3.model; - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; -/** -*/ -@IRI("aas:LevelType") +/** + * Value represented by up to four variants of a numeric value in a specific role: MIN, NOM, TYP and + * MAX. True means that the value is available, false means the value is not available. + */ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultLevelType.class) +}) public interface LevelType { - - public boolean getMin(); + /** + * Minimum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/min + * + * @return Returns the boolean for the property min. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/min") + boolean getMin(); - - public void setMin(boolean min); + /** + * Minimum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/min + * + * @param min desired value for the property min. + */ + void setMin(boolean min); - - public boolean getNom(); + /** + * Nominal value (value as designated) + * + * More information under https://admin-shell.io/aas/3/0/LevelType/nom + * + * @return Returns the boolean for the property nom. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/nom") + boolean getNom(); - - public void setNom(boolean nom); + /** + * Nominal value (value as designated) + * + * More information under https://admin-shell.io/aas/3/0/LevelType/nom + * + * @param nom desired value for the property nom. + */ + void setNom(boolean nom); - - public boolean getTyp(); + /** + * Value as typically present + * + * More information under https://admin-shell.io/aas/3/0/LevelType/typ + * + * @return Returns the boolean for the property typ. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/typ") + boolean getTyp(); - - public void setTyp(boolean typ); + /** + * Value as typically present + * + * More information under https://admin-shell.io/aas/3/0/LevelType/typ + * + * @param typ desired value for the property typ. + */ + void setTyp(boolean typ); - - public boolean getMax(); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @return Returns the boolean for the property max. + */ + @IRI("https://admin-shell.io/aas/3/0/LevelType/max") + boolean getMax(); - - public void setMax(boolean max); + /** + * Maximum of the value + * + * More information under https://admin-shell.io/aas/3/0/LevelType/max + * + * @param max desired value for the property max. + */ + void setMax(boolean max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java deleted file mode 100644 index a0e26f775..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelingKind.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - - -/** - * Enumeration for denoting whether an element is a template or an instance. - */ -@IRI("aas:ModelingKind") -public enum ModelingKind { - - /** - * Concrete, clearly identifiable component of a certain template. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Instance") - INSTANCE, - - /** - * Software element which specifies the common attributes shared by all instances of the template. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ModelingKind/Template") - TEMPLATE; - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index 6b91d51af..5058811c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,36 +33,36 @@ public interface MultiLanguageProperty extends DataElement { /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @return Returns the List of LangStrings for the property value. + * @return Returns the List of LangStringTextTypes for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") List getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/value * - * @param value desired value for the property value. + * @param values desired value for the property value. */ - void setValue(List value); + void setValue(List values); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId + * More information under https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 4ba439e71..093835165 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,39 +30,20 @@ }) public interface Operation extends SubmodelElement { - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables - * - * @return Returns the List of OperationVariables for the property inoutputVariables. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") - List getInoutputVariables(); - - /** - * Parameter that is input and output of the operation. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables - * - * @param inoutputVariables desired value for the property inoutputVariables. - */ - void setInoutputVariables(List inoutputVariables); - /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables * * @return Returns the List of OperationVariables for the property inputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") List getInputVariables(); /** * Input parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/inputVariables * * @param inputVariables desired value for the property inputVariables. */ @@ -71,20 +52,39 @@ public interface Operation extends SubmodelElement { /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables * * @return Returns the List of OperationVariables for the property outputVariables. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") List getOutputVariables(); /** * Output parameter of the operation. * - * More information under https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables + * More information under https://admin-shell.io/aas/3/0/Operation/outputVariables * * @param outputVariables desired value for the property outputVariables. */ void setOutputVariables(List outputVariables); + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @return Returns the List of OperationVariables for the property inoutputVariables. + */ + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") + List getInoutputVariables(); + + /** + * Parameter that is input and output of the operation. + * + * More information under https://admin-shell.io/aas/3/0/Operation/inoutputVariables + * + * @param inoutputVariables desired value for the property inoutputVariables. + */ + void setInoutputVariables(List inoutputVariables); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index 2975e42e9..c61563481 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface OperationVariable { /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/OperationVariable/value * * @return Returns the SubmodelElement for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") SubmodelElement getValue(); /** * Describes an argument or result of an operation via a submodel element * - * More information under https://admin-shell.io/aas/3/0/RC02/OperationVariable/value + * More information under https://admin-shell.io/aas/3/0/OperationVariable/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index b937792da..72fc83156 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,20 +29,39 @@ }) public interface Property extends DataElement { + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the value + * + * More information under https://admin-shell.io/aas/3/0/Property/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/value + * More information under https://admin-shell.io/aas/3/0/Property/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") + @IRI("https://admin-shell.io/aas/3/0/Property/value") String getValue(); /** * The value of the property instance. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/value + * More information under https://admin-shell.io/aas/3/0/Property/value * * @param value desired value for the property value. */ @@ -51,39 +70,20 @@ public interface Property extends DataElement { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId + * More information under https://admin-shell.io/aas/3/0/Property/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueId + * More information under https://admin-shell.io/aas/3/0/Property/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the value - * - * More information under https://admin-shell.io/aas/3/0/RC02/Property/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index 6e4389d84..d8f0e2e84 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifiable { /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers * * @return Returns the List of Qualifiers for the property qualifiers. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") List getQualifiers(); /** * Additional qualification of a qualifiable element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers + * More information under https://admin-shell.io/aas/3/0/Qualifiable/qualifiers * * @param qualifiers desired value for the property qualifiers. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index 3f2063d97..fd3876c9d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface Qualifier extends HasSemantics { /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/Qualifier/kind * * @return Returns the QualifierKind for the property kind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") QualifierKind getKind(); /** * The qualifier kind describes the kind of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/kind + * More information under https://admin-shell.io/aas/3/0/Qualifier/kind * * @param kind desired value for the property kind. */ @@ -52,36 +52,55 @@ public interface Qualifier extends HasSemantics { /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/Qualifier/type * * @return Returns the String for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") String getType(); /** * The qualifier type describes the type of the qualifier that is applied to the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/type + * More information under https://admin-shell.io/aas/3/0/Qualifier/type * * @param type desired value for the property type. */ void setType(String type); + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") + DataTypeDefXsd getValueType(); + + /** + * Data type of the qualifier value. + * + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/Qualifier/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") String getValue(); /** * The qualifier value is the value of the qualifier. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/value + * More information under https://admin-shell.io/aas/3/0/Qualifier/value * * @param value desired value for the property value. */ @@ -90,39 +109,20 @@ public interface Qualifier extends HasSemantics { /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") Reference getValueId(); /** * Reference to the global unique ID of a coded value. * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId + * More information under https://admin-shell.io/aas/3/0/Qualifier/valueId * * @param valueId desired value for the property valueId. */ void setValueId(Reference valueId); - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") - DataTypeDefXsd getValueType(); - - /** - * Data type of the qualifier value. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 3919791a2..3f34d3abd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,19 +29,19 @@ public enum QualifierKind { /** * qualifies the semantic definition the element is referring to ('semanticId') */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ConceptQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ConceptQualifier") CONCEPT_QUALIFIER, /** * qualifies the elements within a specific submodel on concept level. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/TemplateQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/TemplateQualifier") TEMPLATE_QUALIFIER, /** * qualifies the value of the element and can change during run-time. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/QualifierKind/ValueQualifier") + @IRI("https://admin-shell.io/aas/3/0/QualifierKind/ValueQualifier") VALUE_QUALIFIER; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index 26b1b0c6e..9c9c60f51 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -30,60 +30,60 @@ public interface Range extends DataElement { /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @return Returns the String for the property max. + * @return Returns the DataTypeDefXsd for the property valueType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") - String getMax(); + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") + DataTypeDefXsd getValueType(); /** - * The maximum value of the range. + * Data type of the min und max * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/max + * More information under https://admin-shell.io/aas/3/0/Range/valueType * - * @param max desired value for the property max. + * @param valueType desired value for the property valueType. */ - void setMax(String max); + void setValueType(DataTypeDefXsd valueType); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/min + * More information under https://admin-shell.io/aas/3/0/Range/min * * @return Returns the String for the property min. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") + @IRI("https://admin-shell.io/aas/3/0/Range/min") String getMin(); /** * The minimum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/min + * More information under https://admin-shell.io/aas/3/0/Range/min * * @param min desired value for the property min. */ void setMin(String min); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @return Returns the DataTypeDefXsd for the property valueType. + * @return Returns the String for the property max. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") - DataTypeDefXsd getValueType(); + @IRI("https://admin-shell.io/aas/3/0/Range/max") + String getMax(); /** - * Data type of the min und max + * The maximum value of the range. * - * More information under https://admin-shell.io/aas/3/0/RC02/Range/valueType + * More information under https://admin-shell.io/aas/3/0/Range/max * - * @param valueType desired value for the property valueType. + * @param max desired value for the property max. */ - void setValueType(DataTypeDefXsd valueType); + void setMax(String max); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index e0fd5497d..71c5e6ad8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = Identifiable.class), - @KnownSubtypes.Type(value = SubmodelElement.class) + @KnownSubtypes.Type(value = SubmodelElement.class), + @KnownSubtypes.Type(value = Identifiable.class) }) public interface Referable extends HasExtensions { @@ -34,101 +34,80 @@ public interface Referable extends HasExtensions { * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category + * More information under https://admin-shell.io/aas/3/0/Referable/category * * @return Returns the String for the property category. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") String getCategory(); /** * The category is a value that gives further meta information w.r.t. to the class of the element. * It affects the expected existence of attributes and the applicability of constraints. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/category + * More information under https://admin-shell.io/aas/3/0/Referable/category * * @param category desired value for the property category. */ void setCategory(String category); /** - * Checksum to be used to determine if an Referable (including its aggregated child elements) has - * changed. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum - * - * @return Returns the String for the property checksum. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - String getChecksum(); - - /** - * Checksum to be used to determine if an Referable (including its aggregated child elements) has - * changed. - * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/checksum - * - * @param checksum desired value for the property checksum. - */ - void setChecksum(String checksum); - - /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @return Returns the List of LangStrings for the property description. + * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") - List getDescription(); + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + String getIdShort(); /** - * Description or comments on the element. + * In case of identifiables this attribute is a short name of the element. In case of referable this + * ID is an identifying string of the element within its name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/description + * More information under https://admin-shell.io/aas/3/0/Referable/idShort * - * @param description desired value for the property description. + * @param idShort desired value for the property idShort. */ - void setDescription(List description); + void setIdShort(String idShort); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @return Returns the List of LangStrings for the property displayName. + * @return Returns the List of LangStringNameTypes for the property displayName. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") List getDisplayName(); /** * Display name. Can be provided in several languages. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/displayName + * More information under https://admin-shell.io/aas/3/0/Referable/displayName * - * @param displayName desired value for the property displayName. + * @param displayNames desired value for the property displayName. */ - void setDisplayName(List displayName); + void setDisplayName(List displayNames); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @return Returns the String for the property idShort. + * @return Returns the List of LangStringTextTypes for the property description. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") - String getIdShort(); + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + List getDescription(); /** - * In case of identifiables this attribute is a short name of the element. In case of referable this - * ID is an identifying string of the element within its name space. + * Description or comments on the element. * - * More information under https://admin-shell.io/aas/3/0/RC02/Referable/idShort + * More information under https://admin-shell.io/aas/3/0/Referable/description * - * @param idShort desired value for the property idShort. + * @param descriptions desired value for the property description. */ - void setIdShort(String idShort); + void setDescription(List descriptions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index 8575d95e8..ee6ceffda 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,60 +31,60 @@ public interface Reference { /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @return Returns the List of Keys for the property keys. + * @return Returns the ReferenceTypes for the property type. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") - List getKeys(); + @IRI("https://admin-shell.io/aas/3/0/Reference/type") + ReferenceTypes getType(); /** - * Unique references in their name space. + * Type of the reference. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/keys + * More information under https://admin-shell.io/aas/3/0/Reference/type * - * @param keys desired value for the property keys. + * @param type desired value for the property type. */ - void setKeys(List keys); + void setType(ReferenceTypes type); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * * @return Returns the Reference for the property referredSemanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") Reference getReferredSemanticId(); /** * 'semanticId' of the referenced model element ('type' = 'ModelReference'). * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId + * More information under https://admin-shell.io/aas/3/0/Reference/referredSemanticId * * @param referredSemanticId desired value for the property referredSemanticId. */ void setReferredSemanticId(Reference referredSemanticId); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @return Returns the ReferenceTypes for the property type. + * @return Returns the List of Keys for the property keys. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") - ReferenceTypes getType(); + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") + List getKeys(); /** - * Type of the reference. + * Unique references in their name space. * - * More information under https://admin-shell.io/aas/3/0/RC02/Reference/type + * More information under https://admin-shell.io/aas/3/0/Reference/keys * - * @param type desired value for the property type. + * @param keys desired value for the property keys. */ - void setType(ReferenceTypes type); + void setKeys(List keys); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index cd13ceb32..40a6de3a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface ReferenceElement extends DataElement { * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value * * @return Returns the Reference for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") Reference getValue(); /** * Global reference to an external object or entity or a logical reference to another element within * the same or another AAS (i.e. a model reference to a Referable). * - * More information under https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value + * More information under https://admin-shell.io/aas/3/0/ReferenceElement/value * * @param value desired value for the property value. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 2f815c8a8..99ded8f49 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -21,21 +21,21 @@ /** - * ReferenceTypes + * Reference types */ @IRI("aas:ReferenceTypes") public enum ReferenceTypes { /** - * GlobalReference. + * External reference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ExternalReference") + @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ExternalReference") EXTERNAL_REFERENCE, /** - * ModelReference + * Model reference. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceTypes/ModelReference") + @IRI("https://admin-shell.io/aas/3/0/ReferenceTypes/ModelReference") MODEL_REFERENCE; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index e2ffe5b1d..986c78aa2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,17 +34,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first * * @return Returns the Reference for the property first. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") Reference getFirst(); /** * Reference to the first element in the relationship taking the role of the subject. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/first * * @param first desired value for the property first. */ @@ -53,17 +53,17 @@ public interface RelationshipElement extends SubmodelElement { /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second * * @return Returns the Reference for the property second. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") Reference getSecond(); /** * Reference to the second element in the relationship taking the role of the object. * - * More information under https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second + * More information under https://admin-shell.io/aas/3/0/RelationshipElement/second * * @param second desired value for the property second. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index ac9f59ae6..4534c1408 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,41 +31,41 @@ public interface Resource { /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @return Returns the String for the property contentType. + * @return Returns the String for the property path. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") - String getContentType(); + @IRI("https://admin-shell.io/aas/3/0/Resource/path") + String getPath(); /** - * Content type of the content of the file. + * Path and name of the resource (with file extension). * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/contentType + * More information under https://admin-shell.io/aas/3/0/Resource/path * - * @param contentType desired value for the property contentType. + * @param path desired value for the property path. */ - void setContentType(String contentType); + void setPath(String path); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @return Returns the String for the property path. + * @return Returns the String for the property contentType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") - String getPath(); + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") + String getContentType(); /** - * Path and name of the resource (with file extension). + * Content type of the content of the file. * - * More information under https://admin-shell.io/aas/3/0/RC02/Resource/path + * More information under https://admin-shell.io/aas/3/0/Resource/contentType * - * @param path desired value for the property path. + * @param contentType desired value for the property contentType. */ - void setPath(String path); + void setContentType(String contentType); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java index 6c54d5d28..c868e3e2b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,39 +29,20 @@ }) public interface SpecificAssetId extends HasSemantics { - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId - * - * @return Returns the Reference for the property externalSubjectId. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") - Reference getExternalSubjectId(); - - /** - * The (external) subject the key belongs to or has meaning to. - * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId - * - * @param externalSubjectId desired value for the property externalSubjectId. - */ - void setExternalSubjectId(Reference externalSubjectId); - /** * Name of the identifier * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/name * * @return Returns the String for the property name. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/name") String getName(); /** * Name of the identifier * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/name * * @param name desired value for the property name. */ @@ -70,20 +51,39 @@ public interface SpecificAssetId extends HasSemantics { /** * The value of the specific asset identifier with the corresponding name. * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/value") String getValue(); /** * The value of the specific asset identifier with the corresponding name. * - * More information under https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/value * * @param value desired value for the property value. */ void setValue(String value); + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId + * + * @return Returns the Reference for the property externalSubjectId. + */ + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId") + Reference getExternalSubjectId(); + + /** + * The (external) subject the key belongs to or has meaning to. + * + * More information under https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId + * + * @param externalSubjectId desired value for the property externalSubjectId. + */ + void setExternalSubjectId(Reference externalSubjectId); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index a52edcf60..c71416c94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -29,13 +29,13 @@ public enum StateOfEvent { /** * Event is off. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/Off") + @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/Off") OFF, /** * Event is on */ - @IRI("https://admin-shell.io/aas/3/0/RC02/StateOfEvent/On") + @IRI("https://admin-shell.io/aas/3/0/StateOfEvent/On") ON; } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 12789fff0..4e8fd3266 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -28,22 +28,22 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, Identifiable, HasSemantics, HasKind, Qualifiable { +public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements * * @return Returns the List of SubmodelElements for the property submodelElements. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") List getSubmodelElements(); /** * A submodel consists of zero or more submodel elements. * - * More information under https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements + * More information under https://admin-shell.io/aas/3/0/Submodel/submodelElements * * @param submodelElements desired value for the property submodelElements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index d864c6344..5c19158d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,15 +24,15 @@ * A submodel element is an element suitable for the description and differentiation of assets. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = DataElement.class), - @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Capability.class), @KnownSubtypes.Type(value = Entity.class), + @KnownSubtypes.Type(value = EventElement.class), @KnownSubtypes.Type(value = Operation.class), + @KnownSubtypes.Type(value = RelationshipElement.class), @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, HasKind, Referable, Qualifiable { +public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index 7a913462d..2080567bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -19,7 +19,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; -import java.util.Collection; +import java.util.List; /** @@ -34,20 +34,20 @@ public interface SubmodelElementCollection extends SubmodelElement { /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @return Returns the Collection of SubmodelElements for the property value. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - Collection getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") + List getValue(); /** * Submodel element contained in the collection. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementCollection/value * - * @param value desired value for the property value. + * @param values desired value for the property value. */ - void setValue(Collection value); + void setValue(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index 34d62ee6c..7e94212b4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,18 +34,18 @@ public interface SubmodelElementList extends SubmodelElement { * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant * * @return Returns the boolean for the property orderRelevant. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") boolean getOrderRelevant(); /** * Defines whether order in list is relevant. If 'orderRelevant' = False then the list is * representing a set or a bag. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant * * @param orderRelevant desired value for the property orderRelevant. */ @@ -54,19 +54,17 @@ public interface SubmodelElementList extends SubmodelElement { /** * Semantic ID the submodel elements contained in the list match to. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * * @return Returns the Reference for the property semanticIdListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") Reference getSemanticIdListElement(); /** * Semantic ID the submodel elements contained in the list match to. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement * * @param semanticIdListElement desired value for the property semanticIdListElement. */ @@ -75,62 +73,58 @@ public interface SubmodelElementList extends SubmodelElement { /** * The submodel element type of the submodel elements contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * * @return Returns the AasSubmodelElements for the property typeValueListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") AasSubmodelElements getTypeValueListElement(); /** * The submodel element type of the submodel elements contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement * * @param typeValueListElement desired value for the property typeValueListElement. */ void setTypeValueListElement(AasSubmodelElements typeValueListElement); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @return Returns the List of SubmodelElements for the property value. + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") - List getValue(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); /** - * Submodel element contained in the list. + * The value type of the submodel element contained in the list. * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement * - * @param value desired value for the property value. + * @param valueTypeListElement desired value for the property valueTypeListElement. */ - void setValue(List value); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @return Returns the DataTypeDefXsd for the property valueTypeListElement. + * @return Returns the List of SubmodelElements for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") + List getValue(); /** - * The value type of the submodel element contained in the list. + * Submodel element contained in the list. * - * More information under - * https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement + * More information under https://admin-shell.io/aas/3/0/SubmodelElementList/value * - * @param valueTypeListElement desired value for the property valueTypeListElement. + * @param values desired value for the property value. */ - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValue(List values); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index cc89c5dcc..9313bc322 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,17 +33,17 @@ public interface ValueList { /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs * * @return Returns the List of ValueReferencePairs for the property valueReferencePairs. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") List getValueReferencePairs(); /** * A pair of a value together with its global unique id. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs + * More information under https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs * * @param valueReferencePairs desired value for the property valueReferencePairs. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 3f6b6dcf2..53d12d3bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -31,19 +31,19 @@ public interface ValueReferencePair { /** - * The value of the referenced concept definition of the value in valueId. + * The value of the referenced concept definition of the value in 'valueId'. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * * @return Returns the String for the property value. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") String getValue(); /** - * The value of the referenced concept definition of the value in valueId. + * The value of the referenced concept definition of the value in 'valueId'. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/value * * @param value desired value for the property value. */ @@ -52,17 +52,17 @@ public interface ValueReferencePair { /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * * @return Returns the Reference for the property valueId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") Reference getValueId(); /** * Global unique id of the value. * - * More information under https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId + * More information under https://admin-shell.io/aas/3/0/ValueReferencePair/valueId * * @param valueId desired value for the property valueId. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java index f37653283..075f2353a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/IRI.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index bf9106f86..1c13de81d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java index 38e364da1..2090757dc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AbstractBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index fc362a1a3..f75faf333 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; @@ -24,6 +25,17 @@ public abstract class AdministrativeInformationBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for version + * + * @param version desired value to be set + * @return Builder object with new value for version + */ + public B version(String version) { + getBuildingInstance().setVersion(version); + return getSelf(); + } + /** * This function allows setting a value for revision * @@ -36,13 +48,24 @@ public B revision(String revision) { } /** - * This function allows setting a value for version + * This function allows setting a value for creator * - * @param version desired value to be set - * @return Builder object with new value for version + * @param creator desired value to be set + * @return Builder object with new value for creator */ - public B version(String version) { - getBuildingInstance().setVersion(version); + public B creator(Reference creator) { + getBuildingInstance().setCreator(creator); + return getSelf(); + } + + /** + * This function allows setting a value for templateId + * + * @param templateId desired value to be set + * @return Builder object with new value for templateId + */ + public B templateId(String templateId) { + getBuildingInstance().setTemplateId(templateId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 995eeabd7..f26548cc2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,9 +20,6 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - - public abstract class AnnotatedRelationshipElementBuilder> extends ExtendableBuilder { @@ -70,22 +67,10 @@ public B second(Reference second) { return getSelf(); } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set * @return Builder object with new value for embeddedDataSpecifications */ public B embeddedDataSpecifications(List embeddedDataSpecifications) { @@ -94,13 +79,13 @@ public B embeddedDataSpecifications(List embeddedData } /** - * This function allows setting a value for kind + * This function allows adding a value to the List embeddedDataSpecifications * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); return getSelf(); } @@ -184,33 +169,44 @@ public B idShort(String idShort) { /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** * This function allows setting a value for description * - * @param description desired value to be set + * @param descriptions desired value to be set * @return Builder object with new value for description */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List description * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param description desired value to be added + * @return Builder object with new value for description */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 12cf93d6f..51e9059c1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,24 +24,24 @@ public abstract class AssetAdministrationShellBuilder { /** - * This function allows setting a value for assetInformation + * This function allows setting a value for derivedFrom * - * @param assetInformation desired value to be set - * @return Builder object with new value for assetInformation + * @param derivedFrom desired value to be set + * @return Builder object with new value for derivedFrom */ - public B assetInformation(AssetInformation assetInformation) { - getBuildingInstance().setAssetInformation(assetInformation); + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().setDerivedFrom(derivedFrom); return getSelf(); } /** - * This function allows setting a value for derivedFrom + * This function allows setting a value for assetInformation * - * @param derivedFrom desired value to be set - * @return Builder object with new value for derivedFrom + * @param assetInformation desired value to be set + * @return Builder object with new value for assetInformation */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().setDerivedFrom(derivedFrom); + public B assetInformation(AssetInformation assetInformation) { + getBuildingInstance().setAssetInformation(assetInformation); return getSelf(); } @@ -123,46 +123,24 @@ public B category(String category) { } /** - * This function allows setting a value for checksum - * - * @param checksum desired value to be set - * @return Builder object with new value for checksum - */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param description desired value to be set - * @return Builder object with new value for description - */ - public B description(List description) { - getBuildingInstance().setDescription(description); - return getSelf(); - } - - /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -178,13 +156,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 5e56f3aa1..974bbcae2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,7 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import java.util.List; @@ -34,17 +37,6 @@ public B assetKind(AssetKind assetKind) { return getSelf(); } - /** - * This function allows setting a value for defaultThumbnail - * - * @param defaultThumbnail desired value to be set - * @return Builder object with new value for defaultThumbnail - */ - public B defaultThumbnail(Resource defaultThumbnail) { - getBuildingInstance().setDefaultThumbnail(defaultThumbnail); - return getSelf(); - } - /** * This function allows setting a value for globalAssetId * @@ -77,4 +69,26 @@ public B specificAssetIds(SpecificAssetId specificAssetIds) { getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } + + /** + * This function allows setting a value for assetType + * + * @param assetType desired value to be set + * @return Builder object with new value for assetType + */ + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); + return getSelf(); + } + + /** + * This function allows setting a value for defaultThumbnail + * + * @param defaultThumbnail desired value to be set + * @return Builder object with new value for defaultThumbnail + */ + public B defaultThumbnail(Resource defaultThumbnail) { + getBuildingInstance().setDefaultThumbnail(defaultThumbnail); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 142160c2e..718767d8b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,6 +23,17 @@ public abstract class BasicEventElementBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for observed + * + * @param observed desired value to be set + * @return Builder object with new value for observed + */ + public B observed(Reference observed) { + getBuildingInstance().setObserved(observed); + return getSelf(); + } + /** * This function allows setting a value for direction * @@ -35,24 +46,24 @@ public B direction(Direction direction) { } /** - * This function allows setting a value for lastUpdate + * This function allows setting a value for state * - * @param lastUpdate desired value to be set - * @return Builder object with new value for lastUpdate + * @param state desired value to be set + * @return Builder object with new value for state */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().setLastUpdate(lastUpdate); + public B state(StateOfEvent state) { + getBuildingInstance().setState(state); return getSelf(); } /** - * This function allows setting a value for maxInterval + * This function allows setting a value for messageTopic * - * @param maxInterval desired value to be set - * @return Builder object with new value for maxInterval + * @param messageTopic desired value to be set + * @return Builder object with new value for messageTopic */ - public B maxInterval(String maxInterval) { - getBuildingInstance().setMaxInterval(maxInterval); + public B messageTopic(String messageTopic) { + getBuildingInstance().setMessageTopic(messageTopic); return getSelf(); } @@ -68,13 +79,13 @@ public B messageBroker(Reference messageBroker) { } /** - * This function allows setting a value for messageTopic + * This function allows setting a value for lastUpdate * - * @param messageTopic desired value to be set - * @return Builder object with new value for messageTopic + * @param lastUpdate desired value to be set + * @return Builder object with new value for lastUpdate */ - public B messageTopic(String messageTopic) { - getBuildingInstance().setMessageTopic(messageTopic); + public B lastUpdate(String lastUpdate) { + getBuildingInstance().setLastUpdate(lastUpdate); return getSelf(); } @@ -90,24 +101,13 @@ public B minInterval(String minInterval) { } /** - * This function allows setting a value for observed - * - * @param observed desired value to be set - * @return Builder object with new value for observed - */ - public B observed(Reference observed) { - getBuildingInstance().setObserved(observed); - return getSelf(); - } - - /** - * This function allows setting a value for state + * This function allows setting a value for maxInterval * - * @param state desired value to be set - * @return Builder object with new value for state + * @param maxInterval desired value to be set + * @return Builder object with new value for maxInterval */ - public B state(StateOfEvent state) { - getBuildingInstance().setState(state); + public B maxInterval(String maxInterval) { + getBuildingInstance().setMaxInterval(maxInterval); return getSelf(); } @@ -167,68 +167,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -244,13 +233,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -275,26 +275,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index cc3569b14..6fe946097 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class BlobBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(byte[] value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(byte[] value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -100,68 +100,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -177,13 +166,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -208,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java index 111002598..cdc11013e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 9fef383bd..2264c9c68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -78,68 +78,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -155,13 +144,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -186,26 +186,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 3977d3764..85c3f259b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,11 +26,11 @@ public abstract class ConceptDescriptionBuilder isCaseOf) { - getBuildingInstance().setIsCaseOf(isCaseOf); + public B isCaseOf(List isCaseOfs) { + getBuildingInstance().setIsCaseOf(isCaseOfs); return getSelf(); } @@ -101,46 +101,24 @@ public B category(String category) { } /** - * This function allows setting a value for checksum - * - * @param checksum desired value to be set - * @return Builder object with new value for checksum - */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param description desired value to be set - * @return Builder object with new value for description - */ - public B description(List description) { - getBuildingInstance().setDescription(description); - return getSelf(); - } - - /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -156,13 +134,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index e48eca4ec..41ce802e4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,58 +23,14 @@ public abstract class DataSpecificationIec61360Builder> extends ExtendableBuilder { - /** - * This function allows setting a value for dataType - * - * @param dataType desired value to be set - * @return Builder object with new value for dataType - */ - public B dataType(DataTypeIec61360 dataType) { - getBuildingInstance().setDataType(dataType); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangString definition) { - getBuildingInstance().getDefinition().add(definition); - return getSelf(); - } - - /** - * This function allows setting a value for levelType - * - * @param levelType desired value to be set - * @return Builder object with new value for levelType - */ - public B levelType(LevelType levelType) { - getBuildingInstance().setLevelType(levelType); - return getSelf(); - } - /** * This function allows setting a value for preferredName * - * @param preferredName desired value to be set + * @param preferredNames desired value to be set * @return Builder object with new value for preferredName */ - public B preferredName(List preferredName) { - getBuildingInstance().setPreferredName(preferredName); + public B preferredName(List preferredNames) { + getBuildingInstance().setPreferredName(preferredNames); return getSelf(); } @@ -84,7 +40,7 @@ public B preferredName(List preferredName) { * @param preferredName desired value to be added * @return Builder object with new value for preferredName */ - public B preferredName(LangString preferredName) { + public B preferredName(LangStringPreferredNameTypeIec61360 preferredName) { getBuildingInstance().getPreferredName().add(preferredName); return getSelf(); } @@ -92,11 +48,11 @@ public B preferredName(LangString preferredName) { /** * This function allows setting a value for shortName * - * @param shortName desired value to be set + * @param shortNames desired value to be set * @return Builder object with new value for shortName */ - public B shortName(List shortName) { - getBuildingInstance().setShortName(shortName); + public B shortName(List shortNames) { + getBuildingInstance().setShortName(shortNames); return getSelf(); } @@ -106,11 +62,33 @@ public B shortName(List shortName) { * @param shortName desired value to be added * @return Builder object with new value for shortName */ - public B shortName(LangString shortName) { + public B shortName(LangStringShortNameTypeIec61360 shortName) { getBuildingInstance().getShortName().add(shortName); return getSelf(); } + /** + * This function allows setting a value for unit + * + * @param unit desired value to be set + * @return Builder object with new value for unit + */ + public B unit(String unit) { + getBuildingInstance().setUnit(unit); + return getSelf(); + } + + /** + * This function allows setting a value for unitId + * + * @param unitId desired value to be set + * @return Builder object with new value for unitId + */ + public B unitId(Reference unitId) { + getBuildingInstance().setUnitId(unitId); + return getSelf(); + } + /** * This function allows setting a value for sourceOfDefinition * @@ -134,35 +112,35 @@ public B symbol(String symbol) { } /** - * This function allows setting a value for unit + * This function allows setting a value for dataType * - * @param unit desired value to be set - * @return Builder object with new value for unit + * @param dataType desired value to be set + * @return Builder object with new value for dataType */ - public B unit(String unit) { - getBuildingInstance().setUnit(unit); + public B dataType(DataTypeIec61360 dataType) { + getBuildingInstance().setDataType(dataType); return getSelf(); } /** - * This function allows setting a value for unitId + * This function allows setting a value for definition * - * @param unitId desired value to be set - * @return Builder object with new value for unitId + * @param definitions desired value to be set + * @return Builder object with new value for definition */ - public B unitId(Reference unitId) { - getBuildingInstance().setUnitId(unitId); + public B definition(List definitions) { + getBuildingInstance().setDefinition(definitions); return getSelf(); } /** - * This function allows setting a value for value + * This function allows adding a value to the List definition * - * @param value desired value to be set - * @return Builder object with new value for value + * @param definition desired value to be added + * @return Builder object with new value for definition */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B definition(LangStringDefinitionTypeIec61360 definition) { + getBuildingInstance().getDefinition().add(definition); return getSelf(); } @@ -188,4 +166,26 @@ public B valueList(ValueList valueList) { return getSelf(); } + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } + + /** + * This function allows setting a value for levelType + * + * @param levelType desired value to be set + * @return Builder object with new value for levelType + */ + public B levelType(LevelType levelType) { + getBuildingInstance().setLevelType(levelType); + return getSelf(); + } + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java deleted file mode 100644 index 75998a955..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - - -public abstract class DataSpecificationPhysicalUnitBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for conversionFactor - * - * @param conversionFactor desired value to be set - * @return Builder object with new value for conversionFactor - */ - public B conversionFactor(String conversionFactor) { - getBuildingInstance().setConversionFactor(conversionFactor); - return getSelf(); - } - - /** - * This function allows setting a value for definition - * - * @param definition desired value to be set - * @return Builder object with new value for definition - */ - public B definition(List definition) { - getBuildingInstance().setDefinition(definition); - return getSelf(); - } - - /** - * This function allows adding a value to the List definition - * - * @param definition desired value to be added - * @return Builder object with new value for definition - */ - public B definition(LangString definition) { - getBuildingInstance().getDefinition().add(definition); - return getSelf(); - } - - /** - * This function allows setting a value for dinNotation - * - * @param dinNotation desired value to be set - * @return Builder object with new value for dinNotation - */ - public B dinNotation(String dinNotation) { - getBuildingInstance().setDinNotation(dinNotation); - return getSelf(); - } - - /** - * This function allows setting a value for eceCode - * - * @param eceCode desired value to be set - * @return Builder object with new value for eceCode - */ - public B eceCode(String eceCode) { - getBuildingInstance().setEceCode(eceCode); - return getSelf(); - } - - /** - * This function allows setting a value for eceName - * - * @param eceName desired value to be set - * @return Builder object with new value for eceName - */ - public B eceName(String eceName) { - getBuildingInstance().setEceName(eceName); - return getSelf(); - } - - /** - * This function allows setting a value for nistName - * - * @param nistName desired value to be set - * @return Builder object with new value for nistName - */ - public B nistName(String nistName) { - getBuildingInstance().setNistName(nistName); - return getSelf(); - } - - /** - * This function allows setting a value for registrationAuthorityId - * - * @param registrationAuthorityId desired value to be set - * @return Builder object with new value for registrationAuthorityId - */ - public B registrationAuthorityId(String registrationAuthorityId) { - getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); - return getSelf(); - } - - /** - * This function allows setting a value for siName - * - * @param siName desired value to be set - * @return Builder object with new value for siName - */ - public B siName(String siName) { - getBuildingInstance().setSiName(siName); - return getSelf(); - } - - /** - * This function allows setting a value for siNotation - * - * @param siNotation desired value to be set - * @return Builder object with new value for siNotation - */ - public B siNotation(String siNotation) { - getBuildingInstance().setSiNotation(siNotation); - return getSelf(); - } - - /** - * This function allows setting a value for sourceOfDefinition - * - * @param sourceOfDefinition desired value to be set - * @return Builder object with new value for sourceOfDefinition - */ - public B sourceOfDefinition(String sourceOfDefinition) { - getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); - return getSelf(); - } - - /** - * This function allows setting a value for supplier - * - * @param supplier desired value to be set - * @return Builder object with new value for supplier - */ - public B supplier(String supplier) { - getBuildingInstance().setSupplier(supplier); - return getSelf(); - } - - /** - * This function allows setting a value for unitName - * - * @param unitName desired value to be set - * @return Builder object with new value for unitName - */ - public B unitName(String unitName) { - getBuildingInstance().setUnitName(unitName); - return getSelf(); - } - - /** - * This function allows setting a value for unitSymbol - * - * @param unitSymbol desired value to be set - * @return Builder object with new value for unitSymbol - */ - public B unitSymbol(String unitSymbol) { - getBuildingInstance().setUnitSymbol(unitSymbol); - return getSelf(); - } - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index 68e175a75..f92f45fe4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 5758ff9b0..fda9f062c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,28 @@ public abstract class EntityBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for statements + * + * @param statements desired value to be set + * @return Builder object with new value for statements + */ + public B statements(List statements) { + getBuildingInstance().setStatements(statements); + return getSelf(); + } + + /** + * This function allows adding a value to the List statements + * + * @param statements desired value to be added + * @return Builder object with new value for statements + */ + public B statements(SubmodelElement statements) { + getBuildingInstance().getStatements().add(statements); + return getSelf(); + } + /** * This function allows setting a value for entityType * @@ -45,35 +67,24 @@ public B globalAssetId(String globalAssetId) { } /** - * This function allows setting a value for specificAssetId + * This function allows setting a value for specificAssetIds * - * @param specificAssetId desired value to be set - * @return Builder object with new value for specificAssetId + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds */ - public B specificAssetId(SpecificAssetId specificAssetId) { - getBuildingInstance().setSpecificAssetId(specificAssetId); + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for statements + * This function allows adding a value to the List specificAssetIds * - * @param statements desired value to be set - * @return Builder object with new value for statements + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(SubmodelElement statements) { - getBuildingInstance().getStatements().add(statements); + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } @@ -133,68 +144,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -210,13 +210,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -241,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index 0c10eab94..60288ffc2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -48,46 +48,46 @@ public B assetAdministrationShells(AssetAdministrationShell assetAdministrationS } /** - * This function allows setting a value for conceptDescriptions + * This function allows setting a value for submodels * - * @param conceptDescriptions desired value to be set - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be set + * @return Builder object with new value for submodels */ - public B conceptDescriptions(List conceptDescriptions) { - getBuildingInstance().setConceptDescriptions(conceptDescriptions); + public B submodels(List submodels) { + getBuildingInstance().setSubmodels(submodels); return getSelf(); } /** - * This function allows adding a value to the List conceptDescriptions + * This function allows adding a value to the List submodels * - * @param conceptDescriptions desired value to be added - * @return Builder object with new value for conceptDescriptions + * @param submodels desired value to be added + * @return Builder object with new value for submodels */ - public B conceptDescriptions(ConceptDescription conceptDescriptions) { - getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); + public B submodels(Submodel submodels) { + getBuildingInstance().getSubmodels().add(submodels); return getSelf(); } /** - * This function allows setting a value for submodels + * This function allows setting a value for conceptDescriptions * - * @param submodels desired value to be set - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be set + * @return Builder object with new value for conceptDescriptions */ - public B submodels(List submodels) { - getBuildingInstance().setSubmodels(submodels); + public B conceptDescriptions(List conceptDescriptions) { + getBuildingInstance().setConceptDescriptions(conceptDescriptions); return getSelf(); } /** - * This function allows adding a value to the List submodels + * This function allows adding a value to the List conceptDescriptions * - * @param submodels desired value to be added - * @return Builder object with new value for submodels + * @param conceptDescriptions desired value to be added + * @return Builder object with new value for conceptDescriptions */ - public B submodels(Submodel submodels) { - getBuildingInstance().getSubmodels().add(submodels); + public B conceptDescriptions(ConceptDescription conceptDescriptions) { + getBuildingInstance().getConceptDescriptions().add(conceptDescriptions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index 64012e1fb..b3e691032 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,57 +23,57 @@ public abstract class EventPayloadBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for observableReference + * This function allows setting a value for source * - * @param observableReference desired value to be set - * @return Builder object with new value for observableReference + * @param source desired value to be set + * @return Builder object with new value for source */ - public B observableReference(Reference observableReference) { - getBuildingInstance().setObservableReference(observableReference); + public B source(Reference source) { + getBuildingInstance().setSource(source); return getSelf(); } /** - * This function allows setting a value for observableSemanticId + * This function allows setting a value for sourceSemanticId * - * @param observableSemanticId desired value to be set - * @return Builder object with new value for observableSemanticId + * @param sourceSemanticId desired value to be set + * @return Builder object with new value for sourceSemanticId */ - public B observableSemanticId(Reference observableSemanticId) { - getBuildingInstance().setObservableSemanticId(observableSemanticId); + public B sourceSemanticId(Reference sourceSemanticId) { + getBuildingInstance().setSourceSemanticId(sourceSemanticId); return getSelf(); } /** - * This function allows setting a value for payload + * This function allows setting a value for observableReference * - * @param payload desired value to be set - * @return Builder object with new value for payload + * @param observableReference desired value to be set + * @return Builder object with new value for observableReference */ - public B payload(String payload) { - getBuildingInstance().setPayload(payload); + public B observableReference(Reference observableReference) { + getBuildingInstance().setObservableReference(observableReference); return getSelf(); } /** - * This function allows setting a value for source + * This function allows setting a value for observableSemanticId * - * @param source desired value to be set - * @return Builder object with new value for source + * @param observableSemanticId desired value to be set + * @return Builder object with new value for observableSemanticId */ - public B source(Reference source) { - getBuildingInstance().setSource(source); + public B observableSemanticId(Reference observableSemanticId) { + getBuildingInstance().setObservableSemanticId(observableSemanticId); return getSelf(); } /** - * This function allows setting a value for sourceSemanticId + * This function allows setting a value for topic * - * @param sourceSemanticId desired value to be set - * @return Builder object with new value for sourceSemanticId + * @param topic desired value to be set + * @return Builder object with new value for topic */ - public B sourceSemanticId(Reference sourceSemanticId) { - getBuildingInstance().setSourceSemanticId(sourceSemanticId); + public B topic(String topic) { + getBuildingInstance().setTopic(topic); return getSelf(); } @@ -100,13 +100,13 @@ public B timeStamp(String timeStamp) { } /** - * This function allows setting a value for topic + * This function allows setting a value for payload * - * @param topic desired value to be set - * @return Builder object with new value for topic + * @param payload desired value to be set + * @return Builder object with new value for payload */ - public B topic(String topic) { - getBuildingInstance().setTopic(topic); + public B payload(byte[] payload) { + getBuildingInstance().setPayload(payload); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java index 801912796..f11f39f72 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtendableBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index 624c24af8..d6dc6f4b4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,13 +36,13 @@ public B name(String name) { } /** - * This function allows setting a value for refersTo + * This function allows setting a value for valueType * - * @param refersTo desired value to be set - * @return Builder object with new value for refersTo + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B refersTo(Reference refersTo) { - getBuildingInstance().setRefersTo(refersTo); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -58,13 +58,24 @@ public B value(String value) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for refersTo * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param refersTos desired value to be set + * @return Builder object with new value for refersTo */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B refersTo(List refersTos) { + getBuildingInstance().setRefersTo(refersTos); + return getSelf(); + } + + /** + * This function allows adding a value to the List refersTo + * + * @param refersTo desired value to be added + * @return Builder object with new value for refersTo + */ + public B refersTo(Reference refersTo) { + getBuildingInstance().getRefersTo().add(refersTo); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index 28fae5424..4bca2a16f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,24 +23,24 @@ public abstract class FileBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for value * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param value desired value to be set + * @return Builder object with new value for value */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B value(String value) { + getBuildingInstance().setValue(value); return getSelf(); } /** - * This function allows setting a value for value + * This function allows setting a value for contentType * - * @param value desired value to be set - * @return Builder object with new value for value + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B value(String value) { - getBuildingInstance().setValue(value); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } @@ -100,68 +100,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -177,13 +166,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -208,26 +208,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java index 1b9ca58d6..131e0ee5d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java deleted file mode 100644 index 6b0c50df8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - - -public abstract class LangStringBuilder> extends ExtendableBuilder { - - /** - * - * This function allows setting a value for text - * - * @param text desired value to be set - * - * @return Builder object with new value for text - * - */ - - public B text(String text) { - getBuildingInstance().setText(text); - return getSelf(); - } - - /** - * - * This function allows setting a value for language - * - * @param language desired value to be set - * - * @return Builder object with new value for language - * - */ - - public B language(String language) { - getBuildingInstance().setLanguage(language); - return getSelf(); - } - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java index 1cde475ec..b6d43e28e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java index daf8ebf61..2df57ae9c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java index ad320aab3..685de3530 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java index c15ba46bd..2b37bb3d5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java index 5ce64c49e..55e927566 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java index 4e763ab8d..47bc13d6c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 0a6a178fc..706314092 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -26,11 +26,11 @@ public abstract class MultiLanguagePropertyBuilder value) { - getBuildingInstance().setValue(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } @@ -112,68 +112,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -189,13 +178,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -220,26 +220,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index d54a79149..8c8b23f59 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,28 +22,6 @@ public abstract class OperationBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for inoutputVariables - * - * @param inoutputVariables desired value to be set - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(List inoutputVariables) { - getBuildingInstance().setInoutputVariables(inoutputVariables); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputVariables - * - * @param inoutputVariables desired value to be added - * @return Builder object with new value for inoutputVariables - */ - public B inoutputVariables(OperationVariable inoutputVariables) { - getBuildingInstance().getInoutputVariables().add(inoutputVariables); - return getSelf(); - } - /** * This function allows setting a value for inputVariables * @@ -88,6 +66,28 @@ public B outputVariables(OperationVariable outputVariables) { return getSelf(); } + /** + * This function allows setting a value for inoutputVariables + * + * @param inoutputVariables desired value to be set + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(List inoutputVariables) { + getBuildingInstance().setInoutputVariables(inoutputVariables); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputVariables + * + * @param inoutputVariables desired value to be added + * @return Builder object with new value for inoutputVariables + */ + public B inoutputVariables(OperationVariable inoutputVariables) { + getBuildingInstance().getInoutputVariables().add(inoutputVariables); + return getSelf(); + } + /** * This function allows setting a value for embeddedDataSpecifications * @@ -144,68 +144,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -221,13 +210,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -252,26 +252,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java index 6f429d8d8..cddb89a47 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index de36ed0dd..9ceee2daa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,6 +22,17 @@ public abstract class PropertyBuilder> extends ExtendableBuilder { + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for value * @@ -44,17 +55,6 @@ public B valueId(Reference valueId) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for embeddedDataSpecifications * @@ -111,68 +111,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -188,13 +177,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -219,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index 8e7d7b74d..24427c217 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -47,6 +47,17 @@ public B type(String type) { return getSelf(); } + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + /** * This function allows setting a value for value * @@ -69,17 +80,6 @@ public B valueId(Reference valueId) { return getSelf(); } - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index 35a2a059a..e9bae46c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -23,13 +23,13 @@ public abstract class RangeBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for max + * This function allows setting a value for valueType * - * @param max desired value to be set - * @return Builder object with new value for max + * @param valueType desired value to be set + * @return Builder object with new value for valueType */ - public B max(String max) { - getBuildingInstance().setMax(max); + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); return getSelf(); } @@ -45,13 +45,13 @@ public B min(String min) { } /** - * This function allows setting a value for valueType + * This function allows setting a value for max * - * @param valueType desired value to be set - * @return Builder object with new value for valueType + * @param max desired value to be set + * @return Builder object with new value for max */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); + public B max(String max) { + getBuildingInstance().setMax(max); return getSelf(); } @@ -111,68 +111,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -188,13 +177,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -219,26 +219,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index 0af106b32..afec436d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -25,46 +25,46 @@ public abstract class ReferenceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for keys + * This function allows setting a value for type * - * @param keys desired value to be set - * @return Builder object with new value for keys + * @param type desired value to be set + * @return Builder object with new value for type */ - public B keys(List keys) { - getBuildingInstance().setKeys(keys); + public B type(ReferenceTypes type) { + getBuildingInstance().setType(type); return getSelf(); } /** - * This function allows adding a value to the List keys + * This function allows setting a value for referredSemanticId * - * @param keys desired value to be added - * @return Builder object with new value for keys + * @param referredSemanticId desired value to be set + * @return Builder object with new value for referredSemanticId */ - public B keys(Key keys) { - getBuildingInstance().getKeys().add(keys); + public B referredSemanticId(Reference referredSemanticId) { + getBuildingInstance().setReferredSemanticId(referredSemanticId); return getSelf(); } /** - * This function allows setting a value for referredSemanticId + * This function allows setting a value for keys * - * @param referredSemanticId desired value to be set - * @return Builder object with new value for referredSemanticId + * @param keys desired value to be set + * @return Builder object with new value for keys */ - public B referredSemanticId(Reference referredSemanticId) { - getBuildingInstance().setReferredSemanticId(referredSemanticId); + public B keys(List keys) { + getBuildingInstance().setKeys(keys); return getSelf(); } /** - * This function allows setting a value for type + * This function allows adding a value to the List keys * - * @param type desired value to be set - * @return Builder object with new value for type + * @param keys desired value to be added + * @return Builder object with new value for keys */ - public B type(ReferenceTypes type) { - getBuildingInstance().setType(type); + public B keys(Key keys) { + getBuildingInstance().getKeys().add(keys); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 04c10f8e4..a34e8526f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -90,68 +90,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -167,13 +156,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -198,26 +198,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 90dc6d0b1..1d6208913 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -101,68 +101,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -178,13 +167,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -209,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index 6bd878ef7..9fd9b7d69 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -22,24 +22,24 @@ public abstract class ResourceBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for contentType + * This function allows setting a value for path * - * @param contentType desired value to be set - * @return Builder object with new value for contentType + * @param path desired value to be set + * @return Builder object with new value for path */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); + public B path(String path) { + getBuildingInstance().setPath(path); return getSelf(); } /** - * This function allows setting a value for path + * This function allows setting a value for contentType * - * @param path desired value to be set - * @return Builder object with new value for path + * @param contentType desired value to be set + * @return Builder object with new value for contentType */ - public B path(String path) { - getBuildingInstance().setPath(path); + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java index 188a7a8f2..508446f79 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -24,17 +24,6 @@ public abstract class SpecificAssetIdBuilder> extends ExtendableBuilder { - /** - * This function allows setting a value for externalSubjectId - * - * @param externalSubjectId desired value to be set - * @return Builder object with new value for externalSubjectId - */ - public B externalSubjectId(Reference externalSubjectId) { - getBuildingInstance().setExternalSubjectId(externalSubjectId); - return getSelf(); - } - /** * This function allows setting a value for name * @@ -57,6 +46,17 @@ public B value(String value) { return getSelf(); } + /** + * This function allows setting a value for externalSubjectId + * + * @param externalSubjectId desired value to be set + * @return Builder object with new value for externalSubjectId + */ + public B externalSubjectId(Reference externalSubjectId) { + getBuildingInstance().setExternalSubjectId(externalSubjectId); + return getSelf(); + } + /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index 1bc4b9a66..9b5b784b5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -67,90 +67,79 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif } /** - * This function allows setting a value for administration - * - * @param administration desired value to be set - * @return Builder object with new value for administration - */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); - return getSelf(); - } - - /** - * This function allows setting a value for id + * This function allows setting a value for kind * - * @param id desired value to be set - * @return Builder object with new value for id + * @param kind desired value to be set + * @return Builder object with new value for kind */ - public B id(String id) { - getBuildingInstance().setId(id); + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); return getSelf(); } /** - * This function allows setting a value for category + * This function allows setting a value for semanticId * - * @param category desired value to be set - * @return Builder object with new value for category + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows setting a value for supplementalSemanticIds * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for description + * This function allows adding a value to the List supplementalSemanticIds * - * @param description desired value to be set - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for administration * - * @param description desired value to be added - * @return Builder object with new value for description + * @param administration desired value to be set + * @return Builder object with new value for administration */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows setting a value for id * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param id desired value to be set + * @return Builder object with new value for id */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for category * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param category desired value to be set + * @return Builder object with new value for category */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } @@ -166,68 +155,68 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for extensions + * This function allows setting a value for displayName * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param displayNames desired value to be set + * @return Builder object with new value for displayName */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows adding a value to the List displayName * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows setting a value for semanticId + * This function allows setting a value for description * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows adding a value to the List description * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param description desired value to be added + * @return Builder object with new value for description */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for extensions * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows setting a value for kind + * This function allows adding a value to the List extensions * - * @param kind desired value to be set - * @return Builder object with new value for kind + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index fb37809e6..b13efa3e8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,7 +17,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.*; -import java.util.Collection; import java.util.List; @@ -27,11 +26,11 @@ public abstract class SubmodelElementCollectionBuilder value) { - getBuildingInstance().setValue(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } @@ -102,68 +101,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -179,13 +167,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -210,26 +209,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index cabcd023c..f52ed9b36 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -57,35 +57,35 @@ public B typeValueListElement(AasSubmodelElements typeValueListElement) { } /** - * This function allows setting a value for value + * This function allows setting a value for valueTypeListElement * - * @param value desired value to be set - * @return Builder object with new value for value + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement */ - public B value(List value) { - getBuildingInstance().setValue(value); + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); return getSelf(); } /** - * This function allows adding a value to the List value + * This function allows setting a value for value * - * @param value desired value to be added + * @param values desired value to be set * @return Builder object with new value for value */ - public B value(SubmodelElement value) { - getBuildingInstance().getValue().add(value); + public B value(List values) { + getBuildingInstance().setValue(values); return getSelf(); } /** - * This function allows setting a value for valueTypeListElement + * This function allows adding a value to the List value * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement + * @param value desired value to be added + * @return Builder object with new value for value */ - public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); + public B value(SubmodelElement value) { + getBuildingInstance().getValue().add(value); return getSelf(); } @@ -145,68 +145,57 @@ public B supplementalSemanticIds(Reference supplementalSemanticIds) { } /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModelingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for category + * This function allows setting a value for qualifiers * - * @param category desired value to be set - * @return Builder object with new value for category + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows setting a value for checksum + * This function allows adding a value to the List qualifiers * - * @param checksum desired value to be set - * @return Builder object with new value for checksum + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B checksum(String checksum) { - getBuildingInstance().setChecksum(checksum); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for category * - * @param description desired value to be set - * @return Builder object with new value for description + * @param category desired value to be set + * @return Builder object with new value for category */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows setting a value for idShort * - * @param description desired value to be added - * @return Builder object with new value for description + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** * This function allows setting a value for displayName * - * @param displayName desired value to be set + * @param displayNames desired value to be set * @return Builder object with new value for displayName */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } @@ -222,13 +211,24 @@ public B displayName(LangStringNameType displayName) { } /** - * This function allows setting a value for idShort + * This function allows setting a value for description * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } @@ -253,26 +253,4 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java index 524a25820..5050fe0a7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java index bd24f1053..8dfb746d3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index 9a86cd699..e13dbd853 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,6 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AdministrativeInformationBuilder; @@ -35,23 +36,29 @@ @IRI("aas:AdministrativeInformation") public class DefaultAdministrativeInformation implements AdministrativeInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/revision") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/creator") + protected Reference creator; + + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/revision") protected String revision; - @IRI("https://admin-shell.io/aas/3/0/RC02/AdministrativeInformation/version") + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/templateId") + protected String templateId; + + @IRI("https://admin-shell.io/aas/3/0/AdministrativeInformation/version") protected String version; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - public DefaultAdministrativeInformation() { - - } + public DefaultAdministrativeInformation() {} @Override public int hashCode() { - return Objects.hash(this.revision, - this.version, + return Objects.hash(this.version, + this.revision, + this.creator, + this.templateId, this.embeddedDataSpecifications); } @@ -65,12 +72,24 @@ public boolean equals(Object obj) { return false; } else { DefaultAdministrativeInformation other = (DefaultAdministrativeInformation) obj; - return Objects.equals(this.revision, other.revision) && - Objects.equals(this.version, other.version) && + return Objects.equals(this.version, other.version) && + Objects.equals(this.revision, other.revision) && + Objects.equals(this.creator, other.creator) && + Objects.equals(this.templateId, other.templateId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } + @Override + public String getVersion() { + return version; + } + + @Override + public void setVersion(String version) { + this.version = version; + } + @Override public String getRevision() { return revision; @@ -82,13 +101,23 @@ public void setRevision(String revision) { } @Override - public String getVersion() { - return version; + public Reference getCreator() { + return creator; } @Override - public void setVersion(String version) { - this.version = version; + public void setCreator(Reference creator) { + this.creator = creator; + } + + @Override + public String getTemplateId() { + return templateId; + } + + @Override + public void setTemplateId(String templateId) { + this.templateId = templateId; } @Override @@ -101,6 +130,16 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } + public String toString() { + return String.format( + "DefaultAdministrativeInformation (" + "version=%s," + + "revision=%s," + + "creator=%s," + + "templateId=%s," + + ")", + this.version, this.revision, this.creator, this.templateId); + } + /** * This builder class can be used to construct a DefaultAdministrativeInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 902dac60a..7e8ed7c90 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,53 +35,43 @@ @IRI("aas:AnnotatedRelationshipElement") public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/AnnotatedRelationshipElement/annotations") + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElement/annotations") protected List annotations = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultAnnotatedRelationshipElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultAnnotatedRelationshipElement() {} @Override public int hashCode() { @@ -91,14 +81,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -117,14 +105,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -189,13 +175,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +195,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +210,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +234,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElement (" + "annotations=%s," + + ")", + this.annotations); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index cd4830dff..1cc73cb62 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,59 +33,53 @@ @IRI("aas:AssetAdministrationShell") public class DefaultAssetAdministrationShell implements AssetAdministrationShell { - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/assetInformation") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/assetInformation") protected AssetInformation assetInformation; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/derivedFrom") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/derivedFrom") protected Reference derivedFrom; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShell/submodels") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShell/submodels") protected List submodels = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultAssetAdministrationShell() { - - } + public DefaultAssetAdministrationShell() {} @Override public int hashCode() { - return Objects.hash(this.assetInformation, - this.derivedFrom, + return Objects.hash(this.derivedFrom, + this.assetInformation, this.submodels, this.embeddedDataSpecifications, this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions); } @@ -99,39 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.assetInformation, other.assetInformation) && - Objects.equals(this.derivedFrom, other.derivedFrom) && + return Objects.equals(this.derivedFrom, other.derivedFrom) && + Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions); } } @Override - public AssetInformation getAssetInformation() { - return assetInformation; + public Reference getDerivedFrom() { + return derivedFrom; } @Override - public void setAssetInformation(AssetInformation assetInformation) { - this.assetInformation = assetInformation; + public void setDerivedFrom(Reference derivedFrom) { + this.derivedFrom = derivedFrom; } @Override - public Reference getDerivedFrom() { - return derivedFrom; + public AssetInformation getAssetInformation() { + return assetInformation; } @Override - public void setDerivedFrom(Reference derivedFrom) { - this.derivedFrom = derivedFrom; + public void setAssetInformation(AssetInformation assetInformation) { + this.assetInformation = assetInformation; } @Override @@ -185,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -210,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -234,6 +217,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultAssetAdministrationShell (" + "derivedFrom=%s," + + "assetInformation=%s," + + "submodels=%s," + + ")", + this.derivedFrom, this.assetInformation, this.submodels); + } + /** * This builder class can be used to construct a DefaultAssetAdministrationShell bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index a3f9112aa..0dbc4be34 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,7 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; @@ -34,28 +37,30 @@ @IRI("aas:AssetInformation") public class DefaultAssetInformation implements AssetInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/assetKind") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetKind") protected AssetKind assetKind; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/defaultThumbnail") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/assetType") + protected String assetType; + + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/defaultThumbnail") protected Resource defaultThumbnail; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/globalAssetId") protected String globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetInformation/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/AssetInformation/specificAssetIds") protected List specificAssetIds = new ArrayList<>(); - public DefaultAssetInformation() { - - } + public DefaultAssetInformation() {} @Override public int hashCode() { return Objects.hash(this.assetKind, - this.defaultThumbnail, this.globalAssetId, - this.specificAssetIds); + this.specificAssetIds, + this.assetType, + this.defaultThumbnail); } @Override @@ -69,9 +74,10 @@ public boolean equals(Object obj) { } else { DefaultAssetInformation other = (DefaultAssetInformation) obj; return Objects.equals(this.assetKind, other.assetKind) && - Objects.equals(this.defaultThumbnail, other.defaultThumbnail) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds); + Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.assetType, other.assetType) && + Objects.equals(this.defaultThumbnail, other.defaultThumbnail); } } @@ -85,16 +91,6 @@ public void setAssetKind(AssetKind assetKind) { this.assetKind = assetKind; } - @Override - public Resource getDefaultThumbnail() { - return defaultThumbnail; - } - - @Override - public void setDefaultThumbnail(Resource defaultThumbnail) { - this.defaultThumbnail = defaultThumbnail; - } - @Override public String getGlobalAssetId() { return globalAssetId; @@ -115,6 +111,37 @@ public void setSpecificAssetIds(List specificAssetIds) { this.specificAssetIds = specificAssetIds; } + @Override + public String getAssetType() { + return assetType; + } + + @Override + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + @Override + public Resource getDefaultThumbnail() { + return defaultThumbnail; + } + + @Override + public void setDefaultThumbnail(Resource defaultThumbnail) { + this.defaultThumbnail = defaultThumbnail; + } + + public String toString() { + return String.format( + "DefaultAssetInformation (" + "assetKind=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + "assetType=%s," + + "defaultThumbnail=%s," + + ")", + this.assetKind, this.globalAssetId, this.specificAssetIds, this.assetType, this.defaultThumbnail); + } + /** * This builder class can be used to construct a DefaultAssetInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 25616f747..c83be01c2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,90 +33,78 @@ @IRI("aas:BasicEventElement") public class DefaultBasicEventElement implements BasicEventElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/direction") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/direction") protected Direction direction; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/lastUpdate") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/lastUpdate") protected String lastUpdate; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/maxInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/maxInterval") protected String maxInterval; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageBroker") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageBroker") protected Reference messageBroker; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/messageTopic") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/messageTopic") protected String messageTopic; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/minInterval") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/minInterval") protected String minInterval; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/observed") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/observed") protected Reference observed; - @IRI("https://admin-shell.io/aas/3/0/RC02/BasicEventElement/state") + @IRI("https://admin-shell.io/aas/3/0/BasicEventElement/state") protected StateOfEvent state; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBasicEventElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultBasicEventElement() {} @Override public int hashCode() { - return Objects.hash(this.direction, - this.lastUpdate, - this.maxInterval, - this.messageBroker, + return Objects.hash(this.observed, + this.direction, + this.state, this.messageTopic, + this.messageBroker, + this.lastUpdate, this.minInterval, - this.observed, - this.state, + this.maxInterval, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -129,28 +117,36 @@ public boolean equals(Object obj) { return false; } else { DefaultBasicEventElement other = (DefaultBasicEventElement) obj; - return Objects.equals(this.direction, other.direction) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.maxInterval, other.maxInterval) && - Objects.equals(this.messageBroker, other.messageBroker) && + return Objects.equals(this.observed, other.observed) && + Objects.equals(this.direction, other.direction) && + Objects.equals(this.state, other.state) && Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.lastUpdate, other.lastUpdate) && Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.observed, other.observed) && - Objects.equals(this.state, other.state) && + Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public Reference getObserved() { + return observed; + } + + @Override + public void setObserved(Reference observed) { + this.observed = observed; + } + @Override public Direction getDirection() { return direction; @@ -162,23 +158,23 @@ public void setDirection(Direction direction) { } @Override - public String getLastUpdate() { - return lastUpdate; + public StateOfEvent getState() { + return state; } @Override - public void setLastUpdate(String lastUpdate) { - this.lastUpdate = lastUpdate; + public void setState(StateOfEvent state) { + this.state = state; } @Override - public String getMaxInterval() { - return maxInterval; + public String getMessageTopic() { + return messageTopic; } @Override - public void setMaxInterval(String maxInterval) { - this.maxInterval = maxInterval; + public void setMessageTopic(String messageTopic) { + this.messageTopic = messageTopic; } @Override @@ -192,13 +188,13 @@ public void setMessageBroker(Reference messageBroker) { } @Override - public String getMessageTopic() { - return messageTopic; + public String getLastUpdate() { + return lastUpdate; } @Override - public void setMessageTopic(String messageTopic) { - this.messageTopic = messageTopic; + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; } @Override @@ -212,23 +208,13 @@ public void setMinInterval(String minInterval) { } @Override - public Reference getObserved() { - return observed; - } - - @Override - public void setObserved(Reference observed) { - this.observed = observed; - } - - @Override - public StateOfEvent getState() { - return state; + public String getMaxInterval() { + return maxInterval; } @Override - public void setState(StateOfEvent state) { - this.state = state; + public void setMaxInterval(String maxInterval) { + this.maxInterval = maxInterval; } @Override @@ -262,13 +248,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -282,23 +268,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -307,18 +283,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -331,14 +307,19 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBasicEventElement (" + "observed=%s," + + "direction=%s," + + "state=%s," + + "messageTopic=%s," + + "messageBroker=%s," + + "lastUpdate=%s," + + "minInterval=%s," + + "maxInterval=%s," + + ")", + this.observed, this.direction, this.state, this.messageTopic, this.messageBroker, this.lastUpdate, this.minInterval, + this.maxInterval); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 47e6fca08..f0e59a60d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,68 +35,54 @@ @IRI("aas:Blob") public class DefaultBlob implements Blob { - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/contentType") + @IRI("https://admin-shell.io/aas/3/0/Blob/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Blob/value") + @IRI("https://admin-shell.io/aas/3/0/Blob/value") protected byte[] value; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultBlob() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultBlob() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - Arrays.hashCode(this.value), + return Objects.hash(Arrays.hashCode(this.value), + this.contentType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -109,40 +95,38 @@ public boolean equals(Object obj) { return false; } else { DefaultBlob other = (DefaultBlob) obj; - return Objects.equals(this.contentType, other.contentType) && - Arrays.equals(this.value, other.value) && + return Arrays.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public byte[] getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(byte[] value) { + this.value = value; } @Override - public byte[] getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(byte[] value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -176,13 +160,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -196,23 +180,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -221,18 +195,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -245,14 +219,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultBlob (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 2201e9b54..6ca35f6bf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,58 +34,46 @@ @IRI("aas:Capability") public class DefaultCapability implements Capability { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultCapability() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -101,14 +89,12 @@ public boolean equals(Object obj) { return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -143,13 +129,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -163,23 +149,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -188,18 +164,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -212,14 +188,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } + public String toString() { + return String.format( + "DefaultCapability (" + + ")" - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + ); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index cbf4079e2..51949170b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,41 +34,34 @@ @IRI("aas:ConceptDescription") public class DefaultConceptDescription implements ConceptDescription { - @IRI("https://admin-shell.io/aas/3/0/RC02/ConceptDescription/isCaseOf") + @IRI("https://admin-shell.io/aas/3/0/ConceptDescription/isCaseOf") protected List isCaseOf = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultConceptDescription() { - - this.category = "PROPERTY"; - - } + public DefaultConceptDescription() {} @Override public int hashCode() { @@ -77,10 +70,9 @@ public int hashCode() { this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions); } @@ -99,10 +91,9 @@ public boolean equals(Object obj) { Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions); } } @@ -113,8 +104,8 @@ public List getIsCaseOf() { } @Override - public void setIsCaseOf(List isCaseOf) { - this.isCaseOf = isCaseOf; + public void setIsCaseOf(List isCaseOfs) { + this.isCaseOf = isCaseOfs; } @Override @@ -158,23 +149,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -183,18 +164,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -207,6 +188,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + public String toString() { + return String.format( + "DefaultConceptDescription (" + "isCaseOf=%s," + + ")", + this.isCaseOf); + } + /** * This builder class can be used to construct a DefaultConceptDescription bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 4b97ea5e2..b772cd0a6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,60 +35,58 @@ @IRI("aas:DataSpecificationIec61360") public class DefaultDataSpecificationIec61360 implements DataSpecificationIec61360 { - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/dataType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/dataType") protected DataTypeIec61360 dataType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/definition") - protected List definition = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/definition") + protected List definition = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/levelType") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/levelType") protected LevelType levelType; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/preferredName") - protected List preferredName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/preferredName") + protected List preferredName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/shortName") - protected List shortName = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/shortName") + protected List shortName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/sourceOfDefinition") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/sourceOfDefinition") protected String sourceOfDefinition; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/symbol") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/symbol") protected String symbol; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unit") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unit") protected String unit; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/unitId") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/unitId") protected Reference unitId; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/value") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueFormat") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueFormat") protected String valueFormat; - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360/valueList") + @IRI("https://admin-shell.io/aas/3/0/DataSpecificationIec61360/valueList") protected ValueList valueList; - public DefaultDataSpecificationIec61360() { - - } + public DefaultDataSpecificationIec61360() {} @Override public int hashCode() { - return Objects.hash(this.dataType, - this.definition, - this.levelType, - this.preferredName, + return Objects.hash(this.preferredName, this.shortName, - this.sourceOfDefinition, - this.symbol, this.unit, this.unitId, - this.value, + this.sourceOfDefinition, + this.symbol, + this.dataType, + this.definition, this.valueFormat, - this.valueList); + this.valueList, + this.value, + this.levelType); } @Override @@ -101,69 +99,59 @@ public boolean equals(Object obj) { return false; } else { DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.dataType, other.dataType) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.levelType, other.levelType) && - Objects.equals(this.preferredName, other.preferredName) && + return Objects.equals(this.preferredName, other.preferredName) && Objects.equals(this.shortName, other.shortName) && - Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && - Objects.equals(this.symbol, other.symbol) && Objects.equals(this.unit, other.unit) && Objects.equals(this.unitId, other.unitId) && - Objects.equals(this.value, other.value) && + Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && + Objects.equals(this.symbol, other.symbol) && + Objects.equals(this.dataType, other.dataType) && + Objects.equals(this.definition, other.definition) && Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList); + Objects.equals(this.valueList, other.valueList) && + Objects.equals(this.value, other.value) && + Objects.equals(this.levelType, other.levelType); } } @Override - public DataTypeIec61360 getDataType() { - return dataType; - } - - @Override - public void setDataType(DataTypeIec61360 dataType) { - this.dataType = dataType; + public List getPreferredName() { + return preferredName; } @Override - public List getDefinition() { - return definition; + public void setPreferredName(List preferredNames) { + this.preferredName = preferredNames; } @Override - public void setDefinition(List definition) { - this.definition = definition; + public List getShortName() { + return shortName; } @Override - public LevelType getLevelType() { - return levelType; + public void setShortName(List shortNames) { + this.shortName = shortNames; } @Override - public void setLevelType(LevelType levelType) { - this.levelType = levelType; - } - - @Override - public List getPreferredName() { - return preferredName; + public String getUnit() { + return unit; } @Override - public void setPreferredName(List preferredName) { - this.preferredName = preferredName; + public void setUnit(String unit) { + this.unit = unit; } @Override - public List getShortName() { - return shortName; + public Reference getUnitId() { + return unitId; } @Override - public void setShortName(List shortName) { - this.shortName = shortName; + public void setUnitId(Reference unitId) { + this.unitId = unitId; } @Override @@ -187,33 +175,23 @@ public void setSymbol(String symbol) { } @Override - public String getUnit() { - return unit; - } - - @Override - public void setUnit(String unit) { - this.unit = unit; - } - - @Override - public Reference getUnitId() { - return unitId; + public DataTypeIec61360 getDataType() { + return dataType; } @Override - public void setUnitId(Reference unitId) { - this.unitId = unitId; + public void setDataType(DataTypeIec61360 dataType) { + this.dataType = dataType; } @Override - public String getValue() { - return value; + public List getDefinition() { + return definition; } @Override - public void setValue(String value) { - this.value = value; + public void setDefinition(List definitions) { + this.definition = definitions; } @Override @@ -236,6 +214,45 @@ public void setValueList(ValueList valueList) { this.valueList = valueList; } + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + @Override + public LevelType getLevelType() { + return levelType; + } + + @Override + public void setLevelType(LevelType levelType) { + this.levelType = levelType; + } + + public String toString() { + return String.format( + "DefaultDataSpecificationIec61360 (" + "preferredName=%s," + + "shortName=%s," + + "unit=%s," + + "unitId=%s," + + "sourceOfDefinition=%s," + + "symbol=%s," + + "dataType=%s," + + "definition=%s," + + "valueFormat=%s," + + "valueList=%s," + + "value=%s," + + "levelType=%s," + + ")", + this.preferredName, this.shortName, this.unit, this.unitId, this.sourceOfDefinition, this.symbol, this.dataType, + this.definition, this.valueFormat, this.valueList, this.value, this.levelType); + } + /** * This builder class can be used to construct a DefaultDataSpecificationIec61360 bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java deleted file mode 100644 index 5abc284d3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit - * - */ - -@IRI("aas:DataSpecificationPhysicalUnit") -public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/conversionFactor") - protected String conversionFactor; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/definition") - protected List definition = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/dinNotation") - protected String dinNotation; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceCode") - protected String eceCode; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/eceName") - protected String eceName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/nistName") - protected String nistName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/registrationAuthorityId") - protected String registrationAuthorityId; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siName") - protected String siName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/siNotation") - protected String siNotation; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/sourceOfDefinition") - protected String sourceOfDefinition; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/supplier") - protected String supplier; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitName") - protected String unitName; - - @IRI("https://admin-shell.io/aas/3/0/RC02/DataSpecificationPhysicalUnit/unitSymbol") - protected String unitSymbol; - - public DefaultDataSpecificationPhysicalUnit() { - - } - - @Override - public int hashCode() { - return Objects.hash(this.conversionFactor, - this.definition, - this.dinNotation, - this.eceCode, - this.eceName, - this.nistName, - this.registrationAuthorityId, - this.siName, - this.siNotation, - this.sourceOfDefinition, - this.supplier, - this.unitName, - this.unitSymbol); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; - return Objects.equals(this.conversionFactor, other.conversionFactor) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.dinNotation, other.dinNotation) && - Objects.equals(this.eceCode, other.eceCode) && - Objects.equals(this.eceName, other.eceName) && - Objects.equals(this.nistName, other.nistName) && - Objects.equals(this.registrationAuthorityId, other.registrationAuthorityId) && - Objects.equals(this.siName, other.siName) && - Objects.equals(this.siNotation, other.siNotation) && - Objects.equals(this.sourceOfDefinition, other.sourceOfDefinition) && - Objects.equals(this.supplier, other.supplier) && - Objects.equals(this.unitName, other.unitName) && - Objects.equals(this.unitSymbol, other.unitSymbol); - } - } - - @Override - public String getConversionFactor() { - return conversionFactor; - } - - @Override - public void setConversionFactor(String conversionFactor) { - this.conversionFactor = conversionFactor; - } - - @Override - public List getDefinition() { - return definition; - } - - @Override - public void setDefinition(List definition) { - this.definition = definition; - } - - @Override - public String getDinNotation() { - return dinNotation; - } - - @Override - public void setDinNotation(String dinNotation) { - this.dinNotation = dinNotation; - } - - @Override - public String getEceCode() { - return eceCode; - } - - @Override - public void setEceCode(String eceCode) { - this.eceCode = eceCode; - } - - @Override - public String getEceName() { - return eceName; - } - - @Override - public void setEceName(String eceName) { - this.eceName = eceName; - } - - @Override - public String getNistName() { - return nistName; - } - - @Override - public void setNistName(String nistName) { - this.nistName = nistName; - } - - @Override - public String getRegistrationAuthorityId() { - return registrationAuthorityId; - } - - @Override - public void setRegistrationAuthorityId(String registrationAuthorityId) { - this.registrationAuthorityId = registrationAuthorityId; - } - - @Override - public String getSiName() { - return siName; - } - - @Override - public void setSiName(String siName) { - this.siName = siName; - } - - @Override - public String getSiNotation() { - return siNotation; - } - - @Override - public void setSiNotation(String siNotation) { - this.siNotation = siNotation; - } - - @Override - public String getSourceOfDefinition() { - return sourceOfDefinition; - } - - @Override - public void setSourceOfDefinition(String sourceOfDefinition) { - this.sourceOfDefinition = sourceOfDefinition; - } - - @Override - public String getSupplier() { - return supplier; - } - - @Override - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - @Override - public String getUnitName() { - return unitName; - } - - @Override - public void setUnitName(String unitName) { - this.unitName = unitName; - } - - @Override - public String getUnitSymbol() { - return unitSymbol; - } - - @Override - public void setUnitSymbol(String unitSymbol) { - this.unitSymbol = unitSymbol; - } - - /** - * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. - */ - public static class Builder extends DataSpecificationPhysicalUnitBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { - return new DefaultDataSpecificationPhysicalUnit(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 16d9fe711..0235e810d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,15 +34,13 @@ @IRI("aas:EmbeddedDataSpecification") public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecification { - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecification") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecification") protected Reference dataSpecification; - @IRI("https://admin-shell.io/aas/3/0/RC02/EmbeddedDataSpecification/dataSpecificationContent") + @IRI("https://admin-shell.io/aas/3/0/EmbeddedDataSpecification/dataSpecificationContent") protected DataSpecificationContent dataSpecificationContent; - public DefaultEmbeddedDataSpecification() { - - } + public DefaultEmbeddedDataSpecification() {} @Override public int hashCode() { @@ -85,6 +83,14 @@ public void setDataSpecificationContent(DataSpecificationContent dataSpecificati this.dataSpecificationContent = dataSpecificationContent; } + public String toString() { + return String.format( + "DefaultEmbeddedDataSpecification (" + "dataSpecification=%s," + + "dataSpecificationContent=%s," + + ")", + this.dataSpecification, this.dataSpecificationContent); + } + /** * This builder class can be used to construct a DefaultEmbeddedDataSpecification bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index 7c50e9497..2b38425b8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,74 +33,62 @@ @IRI("aas:Entity") public class DefaultEntity implements Entity { - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/entityType") + @IRI("https://admin-shell.io/aas/3/0/Entity/entityType") protected EntityType entityType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/Entity/globalAssetId") protected String globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/specificAssetId") - protected SpecificAssetId specificAssetId; + @IRI("https://admin-shell.io/aas/3/0/Entity/specificAssetIds") + protected List specificAssetIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Entity/statements") + @IRI("https://admin-shell.io/aas/3/0/Entity/statements") protected List statements = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultEntity() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultEntity() {} @Override public int hashCode() { - return Objects.hash(this.entityType, + return Objects.hash(this.statements, + this.entityType, this.globalAssetId, - this.specificAssetId, - this.statements, + this.specificAssetIds, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -113,24 +101,32 @@ public boolean equals(Object obj) { return false; } else { DefaultEntity other = (DefaultEntity) obj; - return Objects.equals(this.entityType, other.entityType) && + return Objects.equals(this.statements, other.statements) && + Objects.equals(this.entityType, other.entityType) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetId, other.specificAssetId) && - Objects.equals(this.statements, other.statements) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public List getStatements() { + return statements; + } + + @Override + public void setStatements(List statements) { + this.statements = statements; + } + @Override public EntityType getEntityType() { return entityType; @@ -152,23 +148,13 @@ public void setGlobalAssetId(String globalAssetId) { } @Override - public SpecificAssetId getSpecificAssetId() { - return specificAssetId; - } - - @Override - public void setSpecificAssetId(SpecificAssetId specificAssetId) { - this.specificAssetId = specificAssetId; - } - - @Override - public List getStatements() { - return statements; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setStatements(List statements) { - this.statements = statements; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override @@ -202,13 +188,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -222,23 +208,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -247,18 +223,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -271,14 +247,14 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultEntity (" + "statements=%s," + + "entityType=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + ")", + this.statements, this.entityType, this.globalAssetId, this.specificAssetIds); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 012b4aca8..30d5f6377 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -36,24 +36,22 @@ @IRI("aas:Environment") public class DefaultEnvironment implements Environment { - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/assetAdministrationShells") + @IRI("https://admin-shell.io/aas/3/0/Environment/assetAdministrationShells") protected List assetAdministrationShells = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/conceptDescriptions") + @IRI("https://admin-shell.io/aas/3/0/Environment/conceptDescriptions") protected List conceptDescriptions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Environment/submodels") + @IRI("https://admin-shell.io/aas/3/0/Environment/submodels") protected List submodels = new ArrayList<>(); - public DefaultEnvironment() { - - } + public DefaultEnvironment() {} @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, - this.conceptDescriptions, - this.submodels); + this.submodels, + this.conceptDescriptions); } @Override @@ -67,8 +65,8 @@ public boolean equals(Object obj) { } else { DefaultEnvironment other = (DefaultEnvironment) obj; return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions) && - Objects.equals(this.submodels, other.submodels); + Objects.equals(this.submodels, other.submodels) && + Objects.equals(this.conceptDescriptions, other.conceptDescriptions); } } @@ -83,23 +81,32 @@ public void setAssetAdministrationShells(List assetAdm } @Override - public List getConceptDescriptions() { - return conceptDescriptions; + public List getSubmodels() { + return submodels; } @Override - public void setConceptDescriptions(List conceptDescriptions) { - this.conceptDescriptions = conceptDescriptions; + public void setSubmodels(List submodels) { + this.submodels = submodels; } @Override - public List getSubmodels() { - return submodels; + public List getConceptDescriptions() { + return conceptDescriptions; } @Override - public void setSubmodels(List submodels) { - this.submodels = submodels; + public void setConceptDescriptions(List conceptDescriptions) { + this.conceptDescriptions = conceptDescriptions; + } + + public String toString() { + return String.format( + "DefaultEnvironment (" + "assetAdministrationShells=%s," + + "submodels=%s," + + "conceptDescriptions=%s," + + ")", + this.assetAdministrationShells, this.submodels, this.conceptDescriptions); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index ff4ffe345..750f1c5ff 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,6 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.EventPayloadBuilder; +import java.util.Arrays; import java.util.Objects; @@ -32,44 +33,42 @@ @IRI("aas:EventPayload") public class DefaultEventPayload implements EventPayload { - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableReference") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableReference") protected Reference observableReference; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/observableSemanticId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/observableSemanticId") protected Reference observableSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/payload") - protected String payload; + @IRI("https://admin-shell.io/aas/3/0/EventPayload/payload") + protected byte[] payload; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/source") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/source") protected Reference source; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/sourceSemanticId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/sourceSemanticId") protected Reference sourceSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/subjectId") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/subjectId") protected Reference subjectId; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/timeStamp") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/timeStamp") protected String timeStamp; - @IRI("https://admin-shell.io/aas/3/0/RC02/EventPayload/topic") + @IRI("https://admin-shell.io/aas/3/0/EventPayload/topic") protected String topic; - public DefaultEventPayload() { - - } + public DefaultEventPayload() {} @Override public int hashCode() { - return Objects.hash(this.observableReference, - this.observableSemanticId, - this.payload, - this.source, + return Objects.hash(this.source, this.sourceSemanticId, + this.observableReference, + this.observableSemanticId, + this.topic, this.subjectId, this.timeStamp, - this.topic); + Arrays.hashCode(this.payload)); } @Override @@ -82,65 +81,65 @@ public boolean equals(Object obj) { return false; } else { DefaultEventPayload other = (DefaultEventPayload) obj; - return Objects.equals(this.observableReference, other.observableReference) && - Objects.equals(this.observableSemanticId, other.observableSemanticId) && - Objects.equals(this.payload, other.payload) && - Objects.equals(this.source, other.source) && + return Objects.equals(this.source, other.source) && Objects.equals(this.sourceSemanticId, other.sourceSemanticId) && + Objects.equals(this.observableReference, other.observableReference) && + Objects.equals(this.observableSemanticId, other.observableSemanticId) && + Objects.equals(this.topic, other.topic) && Objects.equals(this.subjectId, other.subjectId) && Objects.equals(this.timeStamp, other.timeStamp) && - Objects.equals(this.topic, other.topic); + Arrays.equals(this.payload, other.payload); } } @Override - public Reference getObservableReference() { - return observableReference; + public Reference getSource() { + return source; } @Override - public void setObservableReference(Reference observableReference) { - this.observableReference = observableReference; + public void setSource(Reference source) { + this.source = source; } @Override - public Reference getObservableSemanticId() { - return observableSemanticId; + public Reference getSourceSemanticId() { + return sourceSemanticId; } @Override - public void setObservableSemanticId(Reference observableSemanticId) { - this.observableSemanticId = observableSemanticId; + public void setSourceSemanticId(Reference sourceSemanticId) { + this.sourceSemanticId = sourceSemanticId; } @Override - public String getPayload() { - return payload; + public Reference getObservableReference() { + return observableReference; } @Override - public void setPayload(String payload) { - this.payload = payload; + public void setObservableReference(Reference observableReference) { + this.observableReference = observableReference; } @Override - public Reference getSource() { - return source; + public Reference getObservableSemanticId() { + return observableSemanticId; } @Override - public void setSource(Reference source) { - this.source = source; + public void setObservableSemanticId(Reference observableSemanticId) { + this.observableSemanticId = observableSemanticId; } @Override - public Reference getSourceSemanticId() { - return sourceSemanticId; + public String getTopic() { + return topic; } @Override - public void setSourceSemanticId(Reference sourceSemanticId) { - this.sourceSemanticId = sourceSemanticId; + public void setTopic(String topic) { + this.topic = topic; } @Override @@ -164,13 +163,28 @@ public void setTimeStamp(String timeStamp) { } @Override - public String getTopic() { - return topic; + public byte[] getPayload() { + return payload; } @Override - public void setTopic(String topic) { - this.topic = topic; + public void setPayload(byte[] payload) { + this.payload = payload; + } + + public String toString() { + return String.format( + "DefaultEventPayload (" + "source=%s," + + "sourceSemanticId=%s," + + "observableReference=%s," + + "observableSemanticId=%s," + + "topic=%s," + + "subjectId=%s," + + "timeStamp=%s," + + "payload=%s," + + ")", + this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, + this.timeStamp, this.payload); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index ffe3224de..eb013ed1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,36 +35,32 @@ @IRI("aas:Extension") public class DefaultExtension implements Extension { - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/name") + @IRI("https://admin-shell.io/aas/3/0/Extension/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/refersTo") - protected Reference refersTo; + @IRI("https://admin-shell.io/aas/3/0/Extension/refersTo") + protected List refersTo = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/value") + @IRI("https://admin-shell.io/aas/3/0/Extension/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Extension/valueType") + @IRI("https://admin-shell.io/aas/3/0/Extension/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - - this.valueType = DataTypeDefXsd.STRING; - - } + public DefaultExtension() {} @Override public int hashCode() { return Objects.hash(this.name, - this.refersTo, - this.value, this.valueType, + this.value, + this.refersTo, this.semanticId, this.supplementalSemanticIds); } @@ -80,9 +76,9 @@ public boolean equals(Object obj) { } else { DefaultExtension other = (DefaultExtension) obj; return Objects.equals(this.name, other.name) && - Objects.equals(this.refersTo, other.refersTo) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && + Objects.equals(this.refersTo, other.refersTo) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -99,13 +95,13 @@ public void setName(String name) { } @Override - public Reference getRefersTo() { - return refersTo; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setRefersTo(Reference refersTo) { - this.refersTo = refersTo; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -119,13 +115,13 @@ public void setValue(String value) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public List getRefersTo() { + return refersTo; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setRefersTo(List refersTos) { + this.refersTo = refersTos; } @Override @@ -148,6 +144,16 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultExtension (" + "name=%s," + + "valueType=%s," + + "value=%s," + + "refersTo=%s," + + ")", + this.name, this.valueType, this.value, this.refersTo); + } + /** * This builder class can be used to construct a DefaultExtension bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 07fbdc6ae..52f767e6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,68 +33,54 @@ @IRI("aas:File") public class DefaultFile implements File { - @IRI("https://admin-shell.io/aas/3/0/RC02/File/contentType") + @IRI("https://admin-shell.io/aas/3/0/File/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/File/value") + @IRI("https://admin-shell.io/aas/3/0/File/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultFile() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultFile() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.value, + return Objects.hash(this.value, + this.contentType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -107,40 +93,38 @@ public boolean equals(Object obj) { return false; } else { DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.value, other.value) && + return Objects.equals(this.value, other.value) && + Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getContentType() { - return contentType; + public String getValue() { + return value; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setValue(String value) { + this.value = value; } @Override - public String getValue() { - return value; + public String getContentType() { + return contentType; } @Override - public void setValue(String value) { - this.value = value; + public void setContentType(String contentType) { + this.contentType = contentType; } @Override @@ -174,13 +158,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -194,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -243,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultFile (" + "value=%s," + + "contentType=%s," + + ")", + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index ad4f10f7f..45d6d6f7e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,15 +32,13 @@ @IRI("aas:Key") public class DefaultKey implements Key { - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/type") + @IRI("https://admin-shell.io/aas/3/0/Key/type") protected KeyTypes type; - @IRI("https://admin-shell.io/aas/3/0/RC02/Key/value") + @IRI("https://admin-shell.io/aas/3/0/Key/value") protected String value; - public DefaultKey() { - - } + public DefaultKey() {} @Override public int hashCode() { @@ -83,6 +81,14 @@ public void setValue(String value) { this.value = value; } + public String toString() { + return String.format( + "DefaultKey (" + "type=%s," + + "value=%s," + + ")", + this.type, this.value); + } + /** * This builder class can be used to construct a DefaultKey bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java deleted file mode 100644 index 30b2300cf..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangString.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringBuilder; - -import java.util.Objects; - - -@IRI("rdf:langString") -public class DefaultLangString implements LangString { - - protected String language = null; - protected String text = null; - - public DefaultLangString() { - super(); - } - - public DefaultLangString(String textAndLanguage) { - if (textAndLanguage.contains("@")) { - String[] splitString = textAndLanguage.split("@"); - this.text = splitString[0]; - this.language = splitString[1]; - } else { - this.text = textAndLanguage; - } - } - - public DefaultLangString(String text, String language) { - this.text = text; - this.language = language; - } - - @Override - public String getLanguage() { - return language; - } - - @Override - public void setLanguage(String language) { - this.language = language; - } - - @Override - public String getText() { - return text; - } - - @Override - public void setText(String text) { - this.text = text; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultLangString other = (DefaultLangString) obj; - return Objects.equals(this.language, other.language) && Objects.equals(this.text, other.text); - } - } - - @Override - public int hashCode() { - return Objects.hash(this.language, this.text); - } - - @Override - public String toString() { - String result = this.text; - if (this.language != null && !this.language.isEmpty()) { - return "\"" + result + "\"@" + this.language; - } - return result; - } - - /** - * This builder class can be used to construct a DefaultLangString bean. - */ - public static class Builder extends LangStringBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultLangString newBuildingInstance() { - return new DefaultLangString(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index da15bb1e0..4c8a473b9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index 39f6e1fe3..cf01867c5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 8e62a44e0..40be9c6fc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index 9b718f90e..f33fc73ee 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index ef6a0b75a..196784d6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 667fa1098..5cf2b4ecd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (c) 2023, SAP SE or an SAP affiliate company * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index f145a7e5d..16705fbb2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,52 +33,40 @@ @IRI("aas:MultiLanguageProperty") public class DefaultMultiLanguageProperty implements MultiLanguageProperty { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/value") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/value") protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/MultiLanguageProperty/valueId") + @IRI("https://admin-shell.io/aas/3/0/MultiLanguageProperty/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultMultiLanguageProperty() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultMultiLanguageProperty() {} @Override public int hashCode() { @@ -87,14 +75,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -112,14 +98,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -129,8 +113,8 @@ public List getValue() { } @Override - public void setValue(List value) { - this.value = value; + public void setValue(List values) { + this.value = values; } @Override @@ -174,13 +158,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -194,23 +178,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -219,18 +193,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -243,14 +217,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultMultiLanguageProperty (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index 570604091..eb713de68 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,70 +33,58 @@ @IRI("aas:Operation") public class DefaultOperation implements Operation { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inoutputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inoutputVariables") protected List inoutputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/inputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/inputVariables") protected List inputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Operation/outputVariables") + @IRI("https://admin-shell.io/aas/3/0/Operation/outputVariables") protected List outputVariables = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultOperation() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultOperation() {} @Override public int hashCode() { - return Objects.hash(this.inoutputVariables, - this.inputVariables, + return Objects.hash(this.inputVariables, this.outputVariables, + this.inoutputVariables, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -109,33 +97,21 @@ public boolean equals(Object obj) { return false; } else { DefaultOperation other = (DefaultOperation) obj; - return Objects.equals(this.inoutputVariables, other.inoutputVariables) && - Objects.equals(this.inputVariables, other.inputVariables) && + return Objects.equals(this.inputVariables, other.inputVariables) && Objects.equals(this.outputVariables, other.outputVariables) && + Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } - @Override - public List getInoutputVariables() { - return inoutputVariables; - } - - @Override - public void setInoutputVariables(List inoutputVariables) { - this.inoutputVariables = inoutputVariables; - } - @Override public List getInputVariables() { return inputVariables; @@ -156,6 +132,16 @@ public void setOutputVariables(List outputVariables) { this.outputVariables = outputVariables; } + @Override + public List getInoutputVariables() { + return inoutputVariables; + } + + @Override + public void setInoutputVariables(List inoutputVariables) { + this.inoutputVariables = inoutputVariables; + } + @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -187,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -207,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -232,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -256,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultOperation (" + "inputVariables=%s," + + "outputVariables=%s," + + "inoutputVariables=%s," + + ")", + this.inputVariables, this.outputVariables, this.inoutputVariables); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index a559f8ac1..17f42b008 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,7 +33,7 @@ @IRI("aas:OperationVariable") public class DefaultOperationVariable implements OperationVariable { - @IRI("https://admin-shell.io/aas/3/0/RC02/OperationVariable/value") + @IRI("https://admin-shell.io/aas/3/0/OperationVariable/value") protected SubmodelElement value; public DefaultOperationVariable() {} @@ -67,6 +67,13 @@ public void setValue(SubmodelElement value) { this.value = value; } + public String toString() { + return String.format( + "DefaultOperationVariable (" + "value=%s," + + ")", + this.value); + } + /** * This builder class can be used to construct a DefaultOperationVariable bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 29a8c7c06..7917d7d94 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,72 +33,58 @@ @IRI("aas:Property") public class DefaultProperty implements Property { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/value") + @IRI("https://admin-shell.io/aas/3/0/Property/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueId") + @IRI("https://admin-shell.io/aas/3/0/Property/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Property/valueType") + @IRI("https://admin-shell.io/aas/3/0/Property/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultProperty() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultProperty() {} @Override public int hashCode() { - return Objects.hash(this.value, + return Objects.hash(this.valueType, + this.value, this.valueId, - this.valueType, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,23 +97,31 @@ public boolean equals(Object obj) { return false; } else { DefaultProperty other = (DefaultProperty) obj; - return Objects.equals(this.value, other.value) && + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public String getValue() { return value; @@ -148,16 +142,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public List getEmbeddedDataSpecifications() { return embeddedDataSpecifications; @@ -189,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultProperty (" + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.valueType, this.value, this.valueId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 659a522bd..4a3447a43 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -37,39 +37,36 @@ @IRI("aas:Qualifier") public class DefaultQualifier implements Qualifier { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/kind") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/kind") protected QualifierKind kind; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/type") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/type") protected String type; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/value") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueId") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueId") protected Reference valueId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifier/valueType") + @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") protected DataTypeDefXsd valueType; - public DefaultQualifier() { - this.kind = QualifierKind.CONCEPT_QUALIFIER; - - } + public DefaultQualifier() {} @Override public int hashCode() { return Objects.hash(this.kind, this.type, + this.valueType, this.value, this.valueId, - this.valueType, this.semanticId, this.supplementalSemanticIds); } @@ -86,9 +83,9 @@ public boolean equals(Object obj) { DefaultQualifier other = (DefaultQualifier) obj; return Objects.equals(this.kind, other.kind) && Objects.equals(this.type, other.type) && + Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && - Objects.equals(this.valueType, other.valueType) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } @@ -114,6 +111,16 @@ public void setType(String type) { this.type = type; } + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + @Override public String getValue() { return value; @@ -134,16 +141,6 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - @Override public Reference getSemanticId() { return semanticId; @@ -164,6 +161,17 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultQualifier (" + "kind=%s," + + "type=%s," + + "valueType=%s," + + "value=%s," + + "valueId=%s," + + ")", + this.kind, this.type, this.valueType, this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultQualifier bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index ce1dcb808..475339717 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,72 +33,58 @@ @IRI("aas:Range") public class DefaultRange implements Range { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/max") + @IRI("https://admin-shell.io/aas/3/0/Range/max") protected String max; - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/min") + @IRI("https://admin-shell.io/aas/3/0/Range/min") protected String min; - @IRI("https://admin-shell.io/aas/3/0/RC02/Range/valueType") + @IRI("https://admin-shell.io/aas/3/0/Range/valueType") protected DataTypeDefXsd valueType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - public DefaultRange() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultRange() {} @Override public int hashCode() { - return Objects.hash(this.max, + return Objects.hash(this.valueType, this.min, - this.valueType, + this.max, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,31 +97,29 @@ public boolean equals(Object obj) { return false; } else { DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.max, other.max) && + return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.min, other.min) && - Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public String getMax() { - return max; + public DataTypeDefXsd getValueType() { + return valueType; } @Override - public void setMax(String max) { - this.max = max; + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; } @Override @@ -149,13 +133,13 @@ public void setMin(String min) { } @Override - public DataTypeDefXsd getValueType() { - return valueType; + public String getMax() { + return max; } @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; + public void setMax(String max) { + this.max = max; } @Override @@ -189,13 +173,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -209,23 +193,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -234,18 +208,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -258,14 +232,13 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRange (" + "valueType=%s," + + "min=%s," + + "max=%s," + + ")", + this.valueType, this.min, this.max); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index be3e718f9..ceed8d70d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -35,24 +35,22 @@ @IRI("aas:Reference") public class DefaultReference implements Reference { - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/keys") + @IRI("https://admin-shell.io/aas/3/0/Reference/keys") protected List keys = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/referredSemanticId") + @IRI("https://admin-shell.io/aas/3/0/Reference/referredSemanticId") protected Reference referredSemanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/Reference/type") + @IRI("https://admin-shell.io/aas/3/0/Reference/type") protected ReferenceTypes type; - public DefaultReference() { - - } + public DefaultReference() {} @Override public int hashCode() { - return Objects.hash(this.keys, + return Objects.hash(this.type, this.referredSemanticId, - this.type); + this.keys); } @Override @@ -65,20 +63,20 @@ public boolean equals(Object obj) { return false; } else { DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.keys, other.keys) && + return Objects.equals(this.type, other.type) && Objects.equals(this.referredSemanticId, other.referredSemanticId) && - Objects.equals(this.type, other.type); + Objects.equals(this.keys, other.keys); } } @Override - public List getKeys() { - return keys; + public ReferenceTypes getType() { + return type; } @Override - public void setKeys(List keys) { - this.keys = keys; + public void setType(ReferenceTypes type) { + this.type = type; } @Override @@ -92,13 +90,22 @@ public void setReferredSemanticId(Reference referredSemanticId) { } @Override - public ReferenceTypes getType() { - return type; + public List getKeys() { + return keys; } @Override - public void setType(ReferenceTypes type) { - this.type = type; + public void setKeys(List keys) { + this.keys = keys; + } + + public String toString() { + return String.format( + "DefaultReference (" + "type=%s," + + "referredSemanticId=%s," + + "keys=%s," + + ")", + this.type, this.referredSemanticId, this.keys); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 730521770..da64e65ec 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,49 +34,37 @@ @IRI("aas:ReferenceElement") public class DefaultReferenceElement implements ReferenceElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/ReferenceElement/value") + @IRI("https://admin-shell.io/aas/3/0/ReferenceElement/value") protected Reference value; - public DefaultReferenceElement() { - - this.category = "VARIABLE"; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultReferenceElement() {} @Override public int hashCode() { @@ -84,14 +72,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -108,14 +94,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -160,13 +144,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -180,23 +164,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -205,18 +179,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -229,14 +203,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultReferenceElement (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 31ce95a0c..d151659c5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,50 +34,40 @@ @IRI("aas:RelationshipElement") public class DefaultRelationshipElement implements RelationshipElement { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/first") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/first") protected Reference first; - @IRI("https://admin-shell.io/aas/3/0/RC02/RelationshipElement/second") + @IRI("https://admin-shell.io/aas/3/0/RelationshipElement/second") protected Reference second; - public DefaultRelationshipElement() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultRelationshipElement() {} @Override public int hashCode() { @@ -86,14 +76,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -111,14 +99,12 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -173,13 +159,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -193,23 +179,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -218,18 +194,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -242,14 +218,12 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultRelationshipElement (" + "first=%s," + + "second=%s," + + ")", + this.first, this.second); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index ae673a6b6..068c2ad83 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -32,20 +32,18 @@ @IRI("aas:Resource") public class DefaultResource implements Resource { - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/contentType") + @IRI("https://admin-shell.io/aas/3/0/Resource/contentType") protected String contentType; - @IRI("https://admin-shell.io/aas/3/0/RC02/Resource/path") + @IRI("https://admin-shell.io/aas/3/0/Resource/path") protected String path; - public DefaultResource() { - - } + public DefaultResource() {} @Override public int hashCode() { - return Objects.hash(this.contentType, - this.path); + return Objects.hash(this.path, + this.contentType); } @Override @@ -58,29 +56,37 @@ public boolean equals(Object obj) { return false; } else { DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.path, other.path); + return Objects.equals(this.path, other.path) && + Objects.equals(this.contentType, other.contentType); } } @Override - public String getContentType() { - return contentType; + public String getPath() { + return path; } @Override - public void setContentType(String contentType) { - this.contentType = contentType; + public void setPath(String path) { + this.path = path; } @Override - public String getPath() { - return path; + public String getContentType() { + return contentType; } @Override - public void setPath(String path) { - this.path = path; + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public String toString() { + return String.format( + "DefaultResource (" + "path=%s," + + "contentType=%s," + + ")", + this.path, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java index a7ecb4299..53122fe0c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,30 +34,28 @@ @IRI("aas:SpecificAssetId") public class DefaultSpecificAssetId implements SpecificAssetId { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/externalSubjectId") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/externalSubjectId") protected Reference externalSubjectId; - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/name") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/name") protected String name; - @IRI("https://admin-shell.io/aas/3/0/RC02/SpecificAssetId/value") + @IRI("https://admin-shell.io/aas/3/0/SpecificAssetId/value") protected String value; - public DefaultSpecificAssetId() { - - } + public DefaultSpecificAssetId() {} @Override public int hashCode() { - return Objects.hash(this.externalSubjectId, - this.name, + return Objects.hash(this.name, this.value, + this.externalSubjectId, this.semanticId, this.supplementalSemanticIds); } @@ -72,24 +70,14 @@ public boolean equals(Object obj) { return false; } else { DefaultSpecificAssetId other = (DefaultSpecificAssetId) obj; - return Objects.equals(this.externalSubjectId, other.externalSubjectId) && - Objects.equals(this.name, other.name) && + return Objects.equals(this.name, other.name) && Objects.equals(this.value, other.value) && + Objects.equals(this.externalSubjectId, other.externalSubjectId) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); } } - @Override - public Reference getExternalSubjectId() { - return externalSubjectId; - } - - @Override - public void setExternalSubjectId(Reference externalSubjectId) { - this.externalSubjectId = externalSubjectId; - } - @Override public String getName() { return name; @@ -110,6 +98,16 @@ public void setValue(String value) { this.value = value; } + @Override + public Reference getExternalSubjectId() { + return externalSubjectId; + } + + @Override + public void setExternalSubjectId(Reference externalSubjectId) { + this.externalSubjectId = externalSubjectId; + } + @Override public Reference getSemanticId() { return semanticId; @@ -130,6 +128,15 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) this.supplementalSemanticIds = supplementalSemanticIds; } + public String toString() { + return String.format( + "DefaultSpecificAssetId (" + "name=%s," + + "value=%s," + + "externalSubjectId=%s," + + ")", + this.name, this.value, this.externalSubjectId); + } + /** * This builder class can be used to construct a DefaultSpecificAssetId bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 1eb569d42..b5697a48f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - ** Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,69 +33,61 @@ @IRI("aas:Submodel") public class DefaultSubmodel implements Submodel { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; + @IRI("https://admin-shell.io/aas/3/0/HasKind/kind") + protected ModellingKind kind; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/administration") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/Identifiable/id") + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/Submodel/submodelElements") + @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodel() {} @Override public int hashCode() { return Objects.hash(this.submodelElements, this.embeddedDataSpecifications, + this.kind, + this.semanticId, + this.supplementalSemanticIds, this.administration, this.id, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, + this.displayName, + this.description, this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.kind, this.qualifiers); } @@ -111,17 +103,16 @@ public boolean equals(Object obj) { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && Objects.equals(this.qualifiers, other.qualifiers); } } @@ -147,63 +138,63 @@ public void setEmbeddedDataSpecifications(List embedd } @Override - public AdministrativeInformation getAdministration() { - return administration; + public ModellingKind getKind() { + return kind; } @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; + public void setKind(ModellingKind kind) { + this.kind = kind; } @Override - public String getId() { - return id; + public Reference getSemanticId() { + return semanticId; } @Override - public void setId(String id) { - this.id = id; + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; } @Override - public String getCategory() { - return category; + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; } @Override - public void setCategory(String category) { - this.category = category; + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; } @Override - public String getChecksum() { - return checksum; + public AdministrativeInformation getAdministration() { + return administration; } @Override - public void setChecksum(String checksum) { - this.checksum = checksum; + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; } @Override - public List getDescription() { - return description; + public String getId() { + return id; } @Override - public void setDescription(List description) { - this.description = description; + public void setId(String id) { + this.id = id; } @Override - public List getDisplayName() { - return displayName; + public String getCategory() { + return category; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setCategory(String category) { + this.category = category; } @Override @@ -217,43 +208,33 @@ public void setIdShort(String idShort) { } @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; + public List getDisplayName() { + return displayName; } @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; + public List getDescription() { + return description; } @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override - public ModelingKind getKind() { - return kind; + public List getExtensions() { + return extensions; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setExtensions(List extensions) { + this.extensions = extensions; } @Override @@ -266,6 +247,13 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } + public String toString() { + return String.format( + "DefaultSubmodel (" + "submodelElements=%s," + + ")", + this.submodelElements); + } + /** * This builder class can be used to construct a DefaultSubmodel bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 9db7dacce..a81775b3b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -20,7 +20,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Objects; @@ -36,47 +35,37 @@ @IRI("aas:SubmodelElementCollection") public class DefaultSubmodelElementCollection implements SubmodelElementCollection { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementCollection/value") - protected Collection value = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementCollection/value") + protected List value = new ArrayList<>(); - public DefaultSubmodelElementCollection() { - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodelElementCollection() {} @Override public int hashCode() { @@ -84,14 +73,12 @@ public int hashCode() { this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -108,25 +95,23 @@ public boolean equals(Object obj) { Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @Override - public Collection getValue() { + public List getValue() { return value; } @Override - public void setValue(Collection value) { - this.value = value; + public void setValue(List values) { + this.value = values; } @Override @@ -160,13 +145,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -180,23 +165,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -205,18 +180,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -229,14 +204,11 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementCollection (" + "value=%s," + + ")", + this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 631726d88..221b3fd75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,79 +33,66 @@ @IRI("aas:SubmodelElementList") public class DefaultSubmodelElementList implements SubmodelElementList { - @IRI("https://admin-shell.io/aas/3/0/RC02/HasDataSpecification/embeddedDataSpecifications") + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") protected List embeddedDataSpecifications = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasExtensions/extensions") + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/HasKind/kind") - protected ModelingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/semanticId") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") protected Reference semanticId; - @IRI("https://admin-shell.io/aas/3/0/RC02/HasSemantics/supplementalSemanticIds") + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Qualifiable/qualifiers") + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") protected List qualifiers = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/category") + @IRI("https://admin-shell.io/aas/3/0/Referable/category") protected String category; - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/checksum") - protected String checksum; - - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/description") + @IRI("https://admin-shell.io/aas/3/0/Referable/description") protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/displayName") + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/Referable/idShort") + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/orderRelevant") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/orderRelevant") protected boolean orderRelevant; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/semanticIdListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/semanticIdListElement") protected Reference semanticIdListElement; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/typeValueListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/typeValueListElement") protected AasSubmodelElements typeValueListElement; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/value") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/value") protected List value = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelElementList/valueTypeListElement") + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() { - this.orderRelevant = Boolean.TRUE; - - this.kind = ModelingKind.INSTANCE; - - } + public DefaultSubmodelElementList() {} @Override public int hashCode() { return Objects.hash(this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, - this.value, this.valueTypeListElement, + this.value, this.embeddedDataSpecifications, this.semanticId, this.supplementalSemanticIds, - this.kind, + this.qualifiers, this.category, - this.checksum, - this.description, - this.displayName, this.idShort, - this.extensions, - this.qualifiers); + this.displayName, + this.description, + this.extensions); } @Override @@ -121,19 +108,17 @@ public boolean equals(Object obj) { return Objects.equals(this.orderRelevant, other.orderRelevant) && Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && Objects.equals(this.typeValueListElement, other.typeValueListElement) && - Objects.equals(this.value, other.value) && Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && + Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.kind, other.kind) && + Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && - Objects.equals(this.checksum, other.checksum) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions); } } @@ -168,23 +153,23 @@ public void setTypeValueListElement(AasSubmodelElements typeValueListElement) { } @Override - public List getValue() { - return value; + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; } @Override - public void setValue(List value) { - this.value = value; + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; } @Override - public DataTypeDefXsd getValueTypeListElement() { - return valueTypeListElement; + public List getValue() { + return value; } @Override - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; + public void setValue(List values) { + this.value = values; } @Override @@ -218,13 +203,13 @@ public void setSupplementalSemanticIds(List supplementalSemanticIds) } @Override - public ModelingKind getKind() { - return kind; + public List getQualifiers() { + return qualifiers; } @Override - public void setKind(ModelingKind kind) { - this.kind = kind; + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; } @Override @@ -238,23 +223,13 @@ public void setCategory(String category) { } @Override - public String getChecksum() { - return checksum; - } - - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - @Override - public List getDescription() { - return description; + public String getIdShort() { + return idShort; } @Override - public void setDescription(List description) { - this.description = description; + public void setIdShort(String idShort) { + this.idShort = idShort; } @Override @@ -263,18 +238,18 @@ public List getDisplayName() { } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public String getIdShort() { - return idShort; + public List getDescription() { + return description; } @Override - public void setIdShort(String idShort) { - this.idShort = idShort; + public void setDescription(List descriptions) { + this.description = descriptions; } @Override @@ -287,14 +262,15 @@ public void setExtensions(List extensions) { this.extensions = extensions; } - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; + public String toString() { + return String.format( + "DefaultSubmodelElementList (" + "orderRelevant=%s," + + "semanticIdListElement=%s," + + "typeValueListElement=%s," + + "valueTypeListElement=%s," + + "value=%s," + + ")", + this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement, this.value); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index d9a5cba53..95df776d9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -34,7 +34,7 @@ @IRI("aas:ValueList") public class DefaultValueList implements ValueList { - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueList/valueReferencePairs") + @IRI("https://admin-shell.io/aas/3/0/ValueList/valueReferencePairs") protected List valueReferencePairs = new ArrayList<>(); public DefaultValueList() {} @@ -68,6 +68,13 @@ public void setValueReferencePairs(List valueReferencePairs) this.valueReferencePairs = valueReferencePairs; } + public String toString() { + return String.format( + "DefaultValueList (" + "valueReferencePairs=%s," + + ")", + this.valueReferencePairs); + } + /** * This builder class can be used to construct a DefaultValueList bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index af589cd39..752281744 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -33,15 +33,13 @@ @IRI("aas:ValueReferencePair") public class DefaultValueReferencePair implements ValueReferencePair { - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/value") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/value") protected String value; - @IRI("https://admin-shell.io/aas/3/0/RC02/ValueReferencePair/valueId") + @IRI("https://admin-shell.io/aas/3/0/ValueReferencePair/valueId") protected Reference valueId; - public DefaultValueReferencePair() { - - } + public DefaultValueReferencePair() {} @Override public int hashCode() { @@ -84,6 +82,14 @@ public void setValueId(Reference valueId) { this.valueId = valueId; } + public String toString() { + return String.format( + "DefaultValueReferencePair (" + "value=%s," + + "valueId=%s," + + ")", + this.value, this.valueId); + } + /** * This builder class can be used to construct a DefaultValueReferencePair bean. */ From 49e6e230d924e5a533688f146a9c206978e703d6 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 10:02:23 +0200 Subject: [PATCH 18/91] Fix the tests in dataformat-core --- .../digitaltwin/aas4j/v3/dataformat/core/AASFull.java | 1 - .../aas4j/v3/dataformat/core/EnumSerializerTest.java | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 527b0f4c3..71900b150 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -18,7 +18,6 @@ import java.util.Arrays; import java.util.Base64; -import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 29a67e198..c080e8cf6 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,14 +70,14 @@ public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { @Test public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { - assertSerialization(Direction.INPUT, "INPUT"); - assertSerialization(Direction.OUTPUT, "OUTPUT"); + assertSerialization(Direction.INPUT, "input"); + assertSerialization(Direction.OUTPUT, "output"); } @Test public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { - assertSerialization(StateOfEvent.ON, "ON"); - assertSerialization(StateOfEvent.OFF, "OFF"); + assertSerialization(StateOfEvent.ON, "on"); + assertSerialization(StateOfEvent.OFF, "off"); } @Test From 3678a6e791b9735a01aa60801ca3cc5dad6d030c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 11:04:14 +0200 Subject: [PATCH 19/91] Fix the compilation errors in XML-Serializer Project --- .../xml/AasXmlNamespaceContext.java | 52 ----------- .../xml/SubmodelElementManager.java | 60 ------------- .../XmlDataformatAnnotationIntrospector.java | 89 ------------------- .../LangStringNodeDeserializer.java | 34 ------- .../LangStringsDeserializer.java | 25 ------ .../xml/mixins/HasSemanticsMixin.java | 2 +- .../xml/mixins/LangStringMixin.java | 33 ------- .../dataformat/xml/mixins/PropertyMixin.java | 2 +- ...IDMixin.java => SpecificAssetIdMixin.java} | 13 ++- .../xml/mixins/SubmodelElementListMixin.java | 2 +- .../serialization/LangStringSerializer.java | 67 -------------- .../LangStringsNameTypeSerializer.java | 2 +- .../serialization/LangStringsSerializer.java | 52 ----------- 13 files changed, 10 insertions(+), 423 deletions(-) delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/{SpecificAssetIDMixin.java => SpecificAssetIdMixin.java} (84%) delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java deleted file mode 100644 index de2b6cd89..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/AasXmlNamespaceContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import java.util.HashMap; -import java.util.Map; - - -public class AasXmlNamespaceContext { - - public static final String AAS_PREFERRED_PREFIX = "aas"; - public static final String AAS_URI = "https://admin-shell.io/aas/3/0/RC02"; - - public static final String ABAC_PREFERRED_PREFIX = "abac"; - public static final String ABAC_URI = "http://www.admin-shell.io/aas/abac/3/0"; - - public static final String COMMON_PREFERRED_PREFIX = "aas_common"; - public static final String COMMON_URI = "http://www.admin-shell.io/aas_common/3/0"; - - public static final String IEC61360_PREFERRED_PREFIX = "IEC61360"; - public static final String IEC61360_URI = "http://www.admin-shell.io/IEC61360/3/0"; - - public static final String XSI_PREFERRED_PREFIX = "xsi"; - public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; - - public static final Map PREFERRED_PREFIX_CONTEXT = new HashMap<>(); - - static { - PREFERRED_PREFIX_CONTEXT.put(AAS_PREFERRED_PREFIX, AAS_URI); - PREFERRED_PREFIX_CONTEXT.put(ABAC_PREFERRED_PREFIX, ABAC_URI); - PREFERRED_PREFIX_CONTEXT.put(COMMON_PREFERRED_PREFIX, COMMON_URI); - PREFERRED_PREFIX_CONTEXT.put(IEC61360_PREFERRED_PREFIX, IEC61360_URI); - PREFERRED_PREFIX_CONTEXT.put(XSI_PREFERRED_PREFIX, XSI_URI); - } - - private AasXmlNamespaceContext() { - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java deleted file mode 100644 index e1b22bc93..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/SubmodelElementManager.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Collectors; - -public class SubmodelElementManager { - - public static Map, String> CLASS_TO_NAME = new HashMap<>(); - public static Map> NAME_TO_CLASS = new HashMap<>(); - - static { - CLASS_TO_NAME.put(DefaultAnnotatedRelationshipElement.class, "annotatedRelationshipElement"); - CLASS_TO_NAME.put(DefaultRelationshipElement.class, "relationshipElement"); - CLASS_TO_NAME.put(DefaultReferenceElement.class, "referenceElement"); - CLASS_TO_NAME.put(DefaultProperty.class, "property"); - CLASS_TO_NAME.put(DefaultFile.class, "file"); - CLASS_TO_NAME.put(DefaultBlob.class, "blob"); - CLASS_TO_NAME.put(DefaultRange.class, "range"); - CLASS_TO_NAME.put(DefaultMultiLanguageProperty.class, "multiLanguageProperty"); - CLASS_TO_NAME.put(DefaultCapability.class, "capability"); - CLASS_TO_NAME.put(DefaultEntity.class, "entity"); - CLASS_TO_NAME.put(DefaultBasicEventElement.class, "basicEventElement"); - CLASS_TO_NAME.put(DefaultEventPayload.class, "eventPayload"); - CLASS_TO_NAME.put(DefaultOperation.class, "operation"); - CLASS_TO_NAME.put(DefaultOperationVariable.class, "operationVariable"); - CLASS_TO_NAME.put(DefaultLangString.class, "langString"); - CLASS_TO_NAME.put(DefaultSubmodelElementCollection.class, "submodelElementCollection"); - NAME_TO_CLASS = CLASS_TO_NAME.entrySet().stream().collect(Collectors.toMap(x -> x.getValue(), x -> x.getKey())); - } - - public static String getXmlName(Class type) { - return CLASS_TO_NAME.get(type); - } - - public static Class getClassByXmlName(String xmlName) { - return NAME_TO_CLASS.get(xmlName); - } - - private SubmodelElementManager() { - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java deleted file mode 100644 index 6c8bc20ee..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDataformatAnnotationIntrospector.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; - -import java.util.Collection; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.cfg.MapperConfig; -import com.fasterxml.jackson.databind.introspect.Annotated; -import com.fasterxml.jackson.databind.introspect.AnnotatedClass; -import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; -import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; - -/** - * This class helps to dynamically decide how to de-/serialize classes and - * properties defined in the AAS model library. It will automatically add a default namespace - * to property names and set a default property order for contained elements. - * - * Will also add @JsonInclude(JsonInclude.Include.NON_EMPTY) to all getter methods returning any type of - * Collection<?> defined in the AAS model - */ -public class XmlDataformatAnnotationIntrospector extends JacksonXmlAnnotationIntrospector { - private static final long serialVersionUID = 1L; - - private static final String GETTER_PREFIX = "get"; - protected String myDefaultNamespace = ""; - - public XmlDataformatAnnotationIntrospector() { - super(); - myDefaultNamespace = AasXmlNamespaceContext.AAS_URI; - } - - public String findNamespace(MapperConfig config, Annotated ann) { - String ns = super.findNamespace(config, ann); - if (ns == null) { - return myDefaultNamespace; - } else { - return ns; - } - } - - @Override - public String[] findSerializationPropertyOrder(AnnotatedClass ac) { - String[] order = super.findSerializationPropertyOrder(ac); - if (order == null) { - order = new String[] { - "extensions", "idShort", "displayNames", "category", "descriptions", "administration", "identification", "kind", "semanticId", - "qualifiers", "embeddedDataSpecification", "dataSpecifications", "isCaseOf", "security", "derivedFrom", "submodels", "assetInformation", "views", "externalSubjectId", "key", "allowDuplicates", "ordered", "valueId", "value", - "max", "min", "type", "valueType", "mimeType", "first", "second", "annotations", "revision", "version", "defaultThumbnail", "globalAssetId", "externalAssetId", "entityType", "statements", "assetKind", "billOfMaterials", - "specificAssetIds", "observed", "inoutputVariables", "inputVariables", "outputVariables", "submodelElements", "containedElements" - }; - } - return order; - } - - @Override - public JsonInclude.Value findPropertyInclusion(Annotated a) { - JsonInclude.Value result = super.findPropertyInclusion(a); - if (result != JsonInclude.Value.empty()) { - return result; - } - if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { - AnnotatedMethod method = (AnnotatedMethod) a; - if (method.getParameterCount() == 0 - && method.getName().startsWith(GETTER_PREFIX) - && Collection.class.isAssignableFrom(method.getRawReturnType()) - && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { - return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); - } - } - return result; - } -} \ No newline at end of file diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java deleted file mode 100644 index cb2dfaa88..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringNodeDeserializer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; - -import java.io.IOException; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.JsonNode; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangString; - -public class LangStringNodeDeserializer implements CustomJsonNodeDeserializer { - @Override - public LangString readValue(JsonNode node, JsonParser parser) throws IOException { - String lang = node.get("language").asText(); - String text = node.get("text").asText(); - return new DefaultLangString.Builder().text(text).language(lang).build(); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java deleted file mode 100644 index eaee8aa90..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; - -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringsDeserializer extends NoEntryWrapperListDeserializer { - public LangStringsDeserializer() { - super("langString", new LangStringNodeDeserializer()); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 5766c9532..9bf5216df 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -18,7 +18,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java deleted file mode 100644 index ec348ca41..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LangStringMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; - - -@JsonPropertyOrder({"language", "text"}) -public interface LangStringMixin { - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "language") - public String getLanguage(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "text") - public String getText(); -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 7f9211a17..385e36446 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,7 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java similarity index 84% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java index 2e815400d..54463ac98 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIDMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,15 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - @JsonPropertyOrder({"hasSemantics", "name", "value", "externalSubjectId"}) -public interface SpecificAssetIDMixin { - +public interface SpecificAssetIdMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "name") public String getName(); @@ -32,5 +31,5 @@ public interface SpecificAssetIDMixin { public String getValue(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "externalSubjectId") - public Reference getExternalSubjectId(); + public Reference getExternalSubjectId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java index cc25e2ef6..cbad40cc0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java deleted file mode 100644 index 3f7a25fe4..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringSerializer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import java.io.IOException; -import java.lang.reflect.Field; - -import javax.xml.namespace.QName; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -public class LangStringSerializer extends JsonSerializer { - - - @Override - public void serialize(LangString langString, JsonGenerator gen, SerializerProvider serializers) throws IOException { - - ToXmlGenerator xgen = (ToXmlGenerator) gen; - try { - Field nextName = xgen.getClass().getDeclaredField("_nextName"); - nextName.setAccessible(true); - QName next = (QName) nextName.get(xgen); - - xgen.setNextName(new QName(AasXmlNamespaceContext.AAS_URI, "langString")); - - serializeLangString(xgen, langString); - - } catch (NoSuchFieldException | IllegalAccessException e) { - // serialize it without changing the namespaces - serializeLangString(xgen, langString); - } - - } - - private void serializeLangString(ToXmlGenerator xgen, LangString langString) throws IOException { - - - xgen.writeStartObject(); - xgen.writeFieldName("language"); - xgen.writeString(langString.getLanguage()); - - xgen.writeFieldName("text"); - xgen.writeString(langString.getValue()); - - xgen.writeEndObject(); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java index 5b2659d1a..b2ef9cc4a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java @@ -19,7 +19,7 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java deleted file mode 100644 index 0b75bb518..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsSerializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.SubmodelElementManager; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.io.IOException; -import java.util.List; - -public class LangStringsSerializer extends NoEntryWrapperListSerializer { - - private LangStringSerializer ser = new LangStringSerializer(); - - @Override - public void serialize(List langStrings, JsonGenerator gen, SerializerProvider serializers) throws IOException { - - ToXmlGenerator xgen = (ToXmlGenerator) gen; - xgen.writeStartObject(); - for (LangString element : langStrings) { - ReflectionHelper.setEmptyListsToNull(element); // call is needed to prevent empty tags (e.g. statements.size=0 leads to , which is not allowed according to the schema - xgen.writeFieldName(SubmodelElementManager.getXmlName(element.getClass())); - ser.serialize(element, xgen, serializers); - } - xgen.writeEndObject(); - - } - - @Override - public Class> handledType() { - return (Class>)(Object)List.class; - } - -} \ No newline at end of file From b1ddf4bcf09484e0b51cebb868b8e1e56fe661e0 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 14:20:16 +0200 Subject: [PATCH 20/91] Fix Some XML Serialization Tests --- .../aas4j/v3/dataformat/core/AASSimple.java | 2 +- .../test/resources/xmlExampleWithModifiedPrefix.xml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 158b8eb36..4234ea749 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -328,7 +328,7 @@ public static ConceptDescription createConceptDescriptionMaxRotationSpeed() { .idShort(MAX_ROTATION_SPEED).category(PROPERTY) .administration(new DefaultAdministrativeInformation.Builder() .version("2") - .revision("2.1") + .revision("1") .build()) .id(_0173_1_02_BAA120_008) .embeddedDataSpecifications( diff --git a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml index 2db066ec3..f0b3b70b5 100644 --- a/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml +++ b/dataformat-xml/src/test/resources/xmlExampleWithModifiedPrefix.xml @@ -187,7 +187,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -237,7 +237,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -292,7 +292,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -346,7 +346,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -369,7 +369,7 @@ EN - ActRotationSpeed + ActualRotationSpeed 1/min @@ -409,7 +409,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 From 1d8e1925de0629a06d5adf89e2a74e9d47de9449 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 4 Jul 2023 15:02:05 +0200 Subject: [PATCH 21/91] Fix some XML Serialization Tests --- .../aas4j/v3/dataformat/core/AASFull.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 71900b150..87ae37db4 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -52,8 +52,8 @@ public static AssetAdministrationShell createAAS1() { )) .id("https://acplt.org/Test_AssetAdministrationShell") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .derivedFrom(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -141,8 +141,8 @@ public static AssetAdministrationShell createAAS4() { )) .id("https://acplt.org/Test_AssetAdministrationShell_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.INSTANCE) @@ -167,8 +167,8 @@ public static Submodel createSubmodel1() { )) .id("http://acplt.org/Submodels/Assets/TestAsset/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -248,7 +248,7 @@ public static Submodel createSubmodel2() { )) .id("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") + .version("0") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -349,8 +349,8 @@ public static Submodel createSubmodel3() { )) .id("https://acplt.org/Test_Submodel") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .kind(ModellingKind.INSTANCE) .semanticId(new DefaultReference.Builder() @@ -917,8 +917,8 @@ public static Submodel createSubmodel6() { .id("https://acplt.org/Test_Submodel_Missing") .kind(ModellingKind.INSTANCE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0").build()) + .version("0") + .revision("9").build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() .type(KeyTypes.GLOBAL_REFERENCE) @@ -1320,8 +1320,8 @@ public static Submodel createSubmodel7() { .id("https://acplt.org/Test_Submodel_Template") .kind(ModellingKind.TEMPLATE) .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .semanticId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1715,8 +1715,8 @@ public static ConceptDescription createConceptDescription1() { )) .id("https://acplt.org/Test_ConceptDescription") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1744,8 +1744,8 @@ public static ConceptDescription createConceptDescription3() { )) .id("https://acplt.org/Test_ConceptDescription_Missing") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .build(); } @@ -1755,8 +1755,8 @@ public static ConceptDescription createConceptDescription4() { .idShort("TestSpec_01") .id("http://acplt.org/DataSpecifciations/Example/Identification") .administration(new DefaultAdministrativeInformation.Builder() - .version("0.9") - .revision("0") + .version("0") + .revision("9") .build()) .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() From 30ee6730e8190cf2f7a7d2199e319535b8b83c88 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 5 Jul 2023 16:38:37 +0200 Subject: [PATCH 22/91] Fix the dataformat-xml project --- .../aas4j/v3/dataformat/core/AASFull.java | 135 +++++++++--------- .../xml/mixins/HasSemanticsMixin.java | 5 +- .../dataformat/xml/mixins/LevelTypeMixin.java | 50 +++++++ .../dataformat/xml/mixins/PropertyMixin.java | 58 +++++++- .../dataformat/xml/mixins/ReferableMixin.java | 10 +- .../v3/dataformat/xml/XmlSerializerTest.java | 2 - .../test/resources/test_demo_full_example.xml | 8 +- .../src/test/resources/xmlExample.xml | 13 +- 8 files changed, 200 insertions(+), 81 deletions(-) create mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 87ae37db4..9133944d1 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -180,6 +180,7 @@ public static Submodel createSubmodel1() { .build()) .submodelElements(new DefaultProperty.Builder() .idShort("ManufacturerName") + .displayName(new DefaultLangStringNameType.Builder().language("en-us").text("Manufacturer Name").build()) .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), new DefaultLangStringTextType.Builder().text("Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist").language("de").build() @@ -213,6 +214,7 @@ public static Submodel createSubmodel1() { .build()) .build()) .submodelElements(new DefaultProperty.Builder() + .category("VARIABLE") .idShort("InstanceId") .description(Arrays.asList( new DefaultLangStringTextType.Builder().text("Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation.").language("en-us").build(), @@ -226,6 +228,12 @@ public static Submodel createSubmodel1() { ) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .supplementalSemanticIds(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("something_random_e14ad770").build()) + .build()) + .supplementalSemanticIds(new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("something_random_bd061acd").build()) + .build()) .value("978-8234-234-342") .valueType(DataTypeDefXsd.STRING) .valueId(new DefaultReference.Builder() @@ -1743,6 +1751,7 @@ public static ConceptDescription createConceptDescription3() { new DefaultLangStringTextType.Builder().text("Ein Beispiel-ConceptDescription für eine Test-Anwendung").language("de").build() )) .id("https://acplt.org/Test_ConceptDescription_Missing") + .category("PROPERTY") .administration(new DefaultAdministrativeInformation.Builder() .version("0") .revision("9") @@ -1752,79 +1761,75 @@ public static ConceptDescription createConceptDescription3() { public static ConceptDescription createConceptDescription4() { return new DefaultConceptDescription.Builder() - .idShort("TestSpec_01") - .id("http://acplt.org/DataSpecifciations/Example/Identification") - .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") + .idShort("TestSpec_01") + .id("http://acplt.org/DataSpecifciations/Example/Identification") + .administration(new DefaultAdministrativeInformation.Builder() + .version("0") + .revision("9") + .build()) + .isCaseOf(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) .build()) - .isCaseOf(new DefaultReference.Builder() + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + )) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") - .build()) + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(new DefaultLevelType.Builder().max(true).build()) + .valueList(new DefaultValueList.Builder() + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) - .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() - )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - - .value("http://acplt.org/Units/SpaceUnit") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST") -// .levelType(LevelType.MIN) - .levelType(new DefaultLevelType.Builder().max(true).build()) - .valueList(new DefaultValueList.Builder() - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - // TODO valueType? - .build()) - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - // TODO valueType? - .build()) - .build()) + .build()) + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId2") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) + .build()) .build()) - .build(); + .build()) + .build()) + .build(); } public static Environment createEnvironment() { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java index 9bf5216df..f16b528f3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java @@ -17,6 +17,7 @@ import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -25,9 +26,11 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + +@JsonPropertyOrder("semanticId, supplementalSemanticIds") public interface HasSemanticsMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "semanticId") - void setSemanticID(Reference semanticID); + void setSemanticId(Reference semanticId); @JsonDeserialize(using = ReferencesDeserializer.class) void setSupplementalSemanticIds(List supplementalSemanticIds); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java new file mode 100644 index 000000000..db54e96eb --- /dev/null +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; + +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; + + +@JsonPropertyOrder({"min", "nom", "typ", "max"}) +public interface LevelTypeMixin { + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "min") + public boolean getMin(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "min") + void setMin(boolean min); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "nom") + public boolean getNom(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "nom") + void setNom(boolean nom); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typ") + public boolean getTyp(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "typ") + void setTyp(boolean typ); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "max") + public boolean getMax(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "max") + void setMax(boolean max); +} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 385e36446..6f4d57d08 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,17 +15,73 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import java.util.List; + /** * * @author schnicke * */ +//@JsonPropertyOrder({"category", "idShort", "displayName", "description", "checksum", "valueId", "valueType", "value" }) +@JsonPropertyOrder({ + "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable + "kind", // --> HasKind + "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics + "qualifier", // --> Qualifiable + "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications + "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List + "valueType", "value", "valueId" // --> Property + , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity + , "first", "second", "annotations" // --> (Annotated)RelationsShipElement + , "inputVariables", "outputVariables", "inoutputVariables" // --> Operation + , "observed","direction","state","messageTopic","messageBroker","lastUpdate","minInterval","maxInterval" // --> BasicEventElement + , "min", "max" // Range +}) public interface PropertyMixin { + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") + void setCategory(String category); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") + String getCategory(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") + void setIdShort(String idShort); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") + String getIdShort(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) + List getDisplayName(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") + @JsonSerialize(using = LangStringsNameTypeSerializer.class) + void setDisplayName(List displayNames); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") + @JsonSerialize(using = LangStringsTextTypeSerializer.class) + List getDescription(); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") + @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) + void setDescription(List descriptions); + + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") + void setValueId(Reference valueId); + @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - void setValueID(Reference valueID); + Reference getValueId(); } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java index 552eb1d3e..d7badcca7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java @@ -35,19 +35,19 @@ public interface ReferableMixin { @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") @JsonSerialize(using = LangStringsTextTypeSerializer.class) - public List getDescription(); + List getDescription(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - public void setDescription(List descriptions); + void setDescription(List descriptions); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - public List getDisplayName(); + List getDisplayName(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") @JsonSerialize(using = LangStringsNameTypeSerializer.class) - public void setDisplayName(List displayNames); + void setDisplayName(List displayNames); - public String getIdShort(); + String getIdShort(); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 6ca6b6c65..994a4e648 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -162,8 +162,6 @@ public void testIsCaseOfAgainstXsdSchema() throws SerializationException, SAXExc assertTrue(errors.isEmpty()); } - - private Set validateAgainstXsdSchema(String xml) throws SAXException { return new XmlSchemaValidator().validateSchema(xml); } diff --git a/dataformat-xml/src/test/resources/test_demo_full_example.xml b/dataformat-xml/src/test/resources/test_demo_full_example.xml index 26fbaefe4..404d23319 100644 --- a/dataformat-xml/src/test/resources/test_demo_full_example.xml +++ b/dataformat-xml/src/test/resources/test_demo_full_example.xml @@ -2386,7 +2386,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -2465,6 +2465,12 @@ TEST + + false + false + false + true + diff --git a/dataformat-xml/src/test/resources/xmlExample.xml b/dataformat-xml/src/test/resources/xmlExample.xml index 5e37d5016..57e811b6f 100644 --- a/dataformat-xml/src/test/resources/xmlExample.xml +++ b/dataformat-xml/src/test/resources/xmlExample.xml @@ -77,6 +77,7 @@ TechnicalData http://i40.customer.com/type/1/1/7A7104BDAB57E184 + Instance ExternalReference @@ -187,7 +188,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -237,7 +238,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -292,7 +293,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -346,7 +347,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 @@ -369,7 +370,7 @@ EN - ActRotationSpeed + ActualRotationSpeed 1/min @@ -409,7 +410,7 @@ GlobalReference - https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360 + https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360 From 18decbf733a7f646e279ae153445adebabe7e5d7 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 6 Jul 2023 16:09:25 +0200 Subject: [PATCH 23/91] Fix the dataformat-json project --- .../v3/dataformat/json/JsonDeserializer.java | 22 ++++ .../v3/dataformat/json/JsonSerializer.java | 2 +- .../json/ReferableDeserializer.java | 26 +++++ ...setAdministrationShellDescriptorMixin.java | 13 +-- .../DataSpecificationPhysicalUnitMixin.java | 101 ----------------- .../json/mixins/LangStringMixin.java | 33 ------ ...IDMixin.java => SpecificAssetIdMixin.java} | 2 +- .../json/mixins/SubmodelDescriptorMixin.java | 12 +- .../dataformat/json/mixins/SubmodelMixin.java | 13 +-- dataformat-json/src/main/resources/aas.json | 2 +- ...strationShellDescriptorSerializerTest.java | 2 +- .../json/JsonReferableDeserializerTest.java | 105 ++++++------------ .../dataformat/json/JsonSerializerTest.java | 2 +- .../v3/dataformat/json/TestDataHelper.java | 7 -- .../src/test/resources/Example-Full.json | 8 +- .../src/test/resources/Example-Simple.json | 13 ++- .../assetAdministrationShellDescriptor.json | 12 +- .../assetAdministrationShellList.json | 16 +-- .../test/resources/submodelDescriptor.json | 6 +- 19 files changed, 137 insertions(+), 260 deletions(-) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/{SpecificAssetIDMixin.java => SpecificAssetIdMixin.java} (93%) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index e5e77c90b..d57a622c1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -15,8 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; @@ -117,6 +121,15 @@ public T readReferable(String referable, Class outputCl } } + @Override + public T readReferable(InputStream src, Class outputClass) throws DeserializationException { + return readReferable(new BufferedReader( + new InputStreamReader(src, DEFAULT_CHARSET)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); + } + @Override public List readReferables(String referables, Class outputClass) throws DeserializationException { try { @@ -129,6 +142,15 @@ public List readReferables(String referables, Class } } + @Override + public List readReferables(InputStream src, Class outputClass) throws DeserializationException { + return readReferables(new BufferedReader( + new InputStreamReader(src, DEFAULT_CHARSET)) + .lines() + .collect(Collectors.joining(System.lineSeparator())), + outputClass); + } + @Override public Reference readReference(String reference) throws DeserializationException { try { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 6e7ceef7c..7ee80bb9d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -92,7 +92,7 @@ public String writeReferable(Referable referable) throws SerializationException @Override public String writeReferables(List referables) throws SerializationException { if(referables.isEmpty()){ - return null; + return "[]"; } try { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java index 36c6ffb26..ef6e787a7 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java @@ -19,7 +19,11 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.List; +import java.util.stream.Collectors; /** * Deserializer Interface for deserialization of referables @@ -39,6 +43,17 @@ public interface ReferableDeserializer { */ T readReferable(String referable, Class outputClass) throws DeserializationException; + /** + * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + T readReferable(InputStream src, Class outputClass) throws DeserializationException; + /** * Deserializes a given string into an instance of * a list of the given Referables @@ -52,4 +67,15 @@ public interface ReferableDeserializer { */ List readReferables(String referables, Class outputClass) throws DeserializationException; + /** + * Deserializes a given input stream into an instance of a list of the given Referable + * + * @param src a input stream representing a Referable + * @param outputClass most specific class of the given Referable + * @param type of the returned element + * @return an instance of the referable + * @throws DeserializationException if deserialization fails + */ + public List readReferables(InputStream src, Class outputClass) throws DeserializationException; + } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 4d589447f..3fe313526 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -16,10 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; @@ -34,16 +33,16 @@ public interface AssetAdministrationShellDescriptorMixin { public void setIdShort(String idShort); @JsonProperty("descriptions") - public List getDescription(); + public List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); @JsonProperty("submodelDescriptors") public List getSubmodelDescriptor(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java deleted file mode 100644 index ee87e0d54..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationPhysicalUnitMixin.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; - -import java.util.List; - -public interface DataSpecificationPhysicalUnitMixin { - - @JsonProperty("conversionFactor") - public List getConversionFactors(); - - @JsonProperty("conversionFactor") - public void setConversionFactors(List conversionFactors); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("definition") - public List getDefinition(); - - @JsonProperty("definition") - public void setDefinition(List definition); - - @JsonProperty("dinNotation") - public List getDinNotations(); - - @JsonProperty("dinNotation") - public void setDinNotations(List dinNotations); - - @JsonProperty("eceCode") - public List getEceCodes(); - - @JsonProperty("eceCode") - public void setEceCodes(List eceCodes); - - @JsonProperty("eceName") - public List getEceNames(); - - @JsonProperty("eceName") - public void setEceNames(List eceNames); - - @JsonProperty("nistName") - public List getNistNames(); - - @JsonProperty("nistName") - public void setNistNames(List nistNames); - - @JsonProperty("siName") - public List getSiNames(); - - @JsonProperty("siName") - public void setSiNames(List siNames); - - @JsonProperty("siNotation") - public List getSiNotations(); - - @JsonProperty("siNotation") - public void setSiNotations(List siNotations); - - @JsonProperty("registrationAuthorityId") - public List getRegistrationAuthorityIds(); - - @JsonProperty("registrationAuthorityId") - public void setRegistrationAuthorityIds(List registrationAuthorityIds); - - @JsonProperty("supplier") - public List getSuppliers(); - - @JsonProperty("supplier") - public void setSuppliers(List suppliers); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("unitName") - public List getUnitNames(); - - @JsonProperty("unitName") - public void setUnitNames(List unitNames); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("unitSymbol") - public List getUnitSymbols(); - - @JsonProperty("unitSymbol") - public void setUnitSymbols(List unitSymbols); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java deleted file mode 100644 index 5a874c713..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/LangStringMixin.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -public interface LangStringMixin { - - @JsonProperty("text") - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getText(); - - @JsonProperty("text") - public void setText(String value); - - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getLanguage(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java similarity index 93% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java index a6a59f46f..94f435137 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIDMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -public interface SpecificAssetIDMixin { +public interface SpecificAssetIdMixin { @JsonProperty("externalSubjectId") public Reference getExternalSubjectID(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 2dc8b5891..faf4b909a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -17,25 +17,25 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import java.util.List; public interface SubmodelDescriptorMixin { @JsonProperty("descriptions") - public List getDescription(); + public List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); @JsonProperty("specificAssetIds") public SpecificAssetId getSpecificAssetId(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index e7a2458c9..d1a7f64a3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -17,10 +17,9 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangString; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import java.util.Collection; import java.util.List; public interface SubmodelMixin { @@ -32,14 +31,14 @@ public interface SubmodelMixin { public void setIdShort(String idShort); @JsonProperty("description") - public List getDescription(); + public List getDescription(); @JsonProperty("description") - public void setDescription(List description); + public void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + public List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + public void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/resources/aas.json b/dataformat-json/src/main/resources/aas.json index 496811106..2fe18a193 100644 --- a/dataformat-json/src/main/resources/aas.json +++ b/dataformat-json/src/main/resources/aas.json @@ -879,7 +879,7 @@ { "properties": { "text": { - "maxLength": 18 + "maxLength": 64 } } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index bef8fd2da..c1af7a607 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -49,7 +49,7 @@ public void testReadAssetAdministrationShellDescriptor() throws IOException, Ser private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { String expected = Files.readString(expectedFile.toPath()); String actual = new JsonSerializer().writeAssetAdministrationShellDescriptor(descriptor); - logger.info(actual); + logger.debug(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index f2edff15d..68ef1d473 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -17,119 +17,84 @@ import static org.junit.Assert.assertEquals; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.util.Arrays; +import java.util.Collections; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; public class JsonReferableDeserializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonReferableDeserializerTest.class); - @Test public void testReadAAS() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShell.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShell aas = new JsonDeserializer().readReferable(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - AssetAdministrationShell aasExpected = environment.getAssetAdministrationShells().get(0); - - assertEquals(aasExpected, aas); + AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); + AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadAASs() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShellList.json"); - String expected = Files.readString(fileExpected.toPath()); - List aas = new JsonDeserializer().readReferables(expected, AssetAdministrationShell.class); - Environment environment = AASFull.ENVIRONMENT; - List aasExpected = Arrays.asList(environment.getAssetAdministrationShells().get(0) - ,environment.getAssetAdministrationShells().get(1)) ; - - assertEquals(aasExpected, aas); + List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); } @Test public void testReadSubmodel() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodel.json"); - String expected = Files.readString(fileExpected.toPath()); - Submodel submodel = new JsonDeserializer().readReferable(expected, Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - Submodel submodelExpected = environment.getSubmodels().get(0); - - assertEquals(submodelExpected, submodel); + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodels() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelList.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodels = new JsonDeserializer().readReferables(expected,Submodel.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelsExpected = Arrays.asList(environment.getSubmodels().get(0),environment.getSubmodels().get(1)); - - assertEquals(submodelsExpected, submodels); + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElement() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElement.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElement submodelElement = new JsonDeserializer().readReferable(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementExpected = environment.getSubmodels().get(0).getSubmodelElements().get(0); - - assertEquals(submodelElementExpected, submodelElement); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); + SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElements() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/listOfSubmodelElements.json"); - String expected = Files.readString(fileExpected.toPath()); - List submodelElements = new JsonDeserializer().readReferables(expected,SubmodelElement.class); - Environment environment = AASFull.ENVIRONMENT; - List submodelElementsExpected = Arrays.asList( - environment.getSubmodels().get(0).getSubmodelElements().get(0), - environment.getSubmodels().get(0).getSubmodelElements().get(1)); ; - - assertEquals(submodelElementsExpected, submodelElements); + List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementList.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementList submodelElementList = new JsonDeserializer().readReferable(expected, SubmodelElementList.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementListExpected = environment.getSubmodels().get(6).getSubmodelElements().get(5); ; - - assertEquals(submodelElementListExpected, submodelElementList); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); + SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + assertEquals(expected, actual); } @Test public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelElementCollection.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelElementCollection submodelElementCollection = new JsonDeserializer().readReferable(expected, SubmodelElementCollection.class); - Environment environment = AASFull.ENVIRONMENT; - SubmodelElement submodelElementCollectionExpected = environment.getSubmodels().get(6).getSubmodelElements().get(6); ; - - assertEquals(submodelElementCollectionExpected, submodelElementCollection); + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); + SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + assertEquals(expected, actual); } -} \ No newline at end of file + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); + assertEquals(emptyList, deserialized); + } +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 21c4b2e77..e0208f0a6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -85,7 +85,7 @@ public void testSerializeEmptyReferableList() throws SerializationException { private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); String actual = new JsonSerializer().write(exampleData.getModel()); - logger.info(actual); + logger.debug(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index a6d6d9c3f..8f1ab22d8 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -33,13 +33,6 @@ public class TestDataHelper { public static final String DEFAULT_ID_SHORT = "defaultIdShort"; - - - - public static LangString createLangString(String langCode, String text) { - return new DefaultLangString.Builder().language(langCode).text(text).build(); - } - public static LangStringTextType createLangStringTextType(String langCode, String text) { return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); } diff --git a/dataformat-json/src/test/resources/Example-Full.json b/dataformat-json/src/test/resources/Example-Full.json index d805d2c41..1e3cf3770 100644 --- a/dataformat-json/src/test/resources/Example-Full.json +++ b/dataformat-json/src/test/resources/Example-Full.json @@ -215,7 +215,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -235,6 +235,12 @@ ], "type": "ExternalReference" }, + "levelType": { + "max": true, + "min": false, + "nom": false, + "typ": false + }, "value": "TEST", "valueFormat": "string", "valueList": { diff --git a/dataformat-json/src/test/resources/Example-Simple.json b/dataformat-json/src/test/resources/Example-Simple.json index c6e66ec23..6b9f78c2d 100644 --- a/dataformat-json/src/test/resources/Example-Simple.json +++ b/dataformat-json/src/test/resources/Example-Simple.json @@ -84,7 +84,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -135,7 +135,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -186,7 +186,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -247,7 +247,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -295,7 +295,7 @@ }, { "language": "EN", - "text": "ActRotationSpeed" + "text": "ActualRotationSpeed" } ] } @@ -313,7 +313,7 @@ "keys": [ { "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" + "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" } ], "type": "ExternalReference" @@ -368,6 +368,7 @@ }, "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", "idShort": "TechnicalData", + "kind": "Instance", "submodelElements": [ { "modelType": "Property", diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json index 17183b3dc..059daa7b0 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -19,10 +19,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -50,7 +50,7 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "externalSubjectId" : { "keys" : [ { @@ -83,10 +83,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -106,7 +106,7 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" } } ] } \ No newline at end of file diff --git a/dataformat-json/src/test/resources/assetAdministrationShellList.json b/dataformat-json/src/test/resources/assetAdministrationShellList.json index bca2ea576..d28d05007 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellList.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellList.json @@ -24,7 +24,7 @@ "value": "https://acplt.org/TestAssetAdministrationShell2" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, "assetInformation": { "assetKind": "Instance", @@ -35,7 +35,7 @@ "value": "https://acplt.org/Test_Asset" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, "submodels": [ @@ -46,7 +46,7 @@ "value": "https://acplt.org/Test_Submodel" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -55,7 +55,7 @@ "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -64,7 +64,7 @@ "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] }, @@ -81,7 +81,7 @@ "value": "https://acplt.org/Test_Asset_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" } }, "submodels": [ @@ -92,7 +92,7 @@ "value": "https://acplt.org/Test_Submodel_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" }, { "keys": [ @@ -101,7 +101,7 @@ "value": "https://acplt.org/Test_Submodel2_Mandatory" } ], - "type": "GlobalReference" + "type": "ExternalReference" } ] } diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json index d518b60e1..164daa569 100644 --- a/dataformat-json/src/test/resources/submodelDescriptor.json +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -19,10 +19,10 @@ "type" : "GlobalReference", "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" }, "dataSpecificationContent" : { - "modelType" : "DataSpecificationIEC61360", + "modelType" : "DataSpecificationIec61360", "preferredName" : [ ] } } ] @@ -42,6 +42,6 @@ "type" : "GlobalReference", "value" : "eClassDefaultSemanticId" } ], - "type" : "GlobalReference" + "type" : "ExternalReference" } } \ No newline at end of file From b0c17e60f84e1e9c79f3a766cbaa76b7b34c14b4 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 10:09:32 +0200 Subject: [PATCH 24/91] Adapt the mixins --- .../AnnotatedRelationshipElementMixin.java | 4 ++-- ...setAdministrationShellDescriptorMixin.java | 20 +++++++++--------- .../mixins/AssetAdministrationShellMixin.java | 2 +- .../json/mixins/AssetInformationMixin.java | 6 +++--- .../v3/dataformat/json/mixins/BlobMixin.java | 2 +- .../json/mixins/ConceptDescriptionMixin.java | 4 ++-- .../DataSpecificationIec61360Mixin.java | 12 +++++------ .../dataformat/json/mixins/EntityMixin.java | 6 +++--- .../json/mixins/EnvironmentMixin.java | 6 +++--- .../json/mixins/ExtensionMixin.java | 2 +- .../v3/dataformat/json/mixins/FileMixin.java | 2 +- .../mixins/HasDataSpecificationMixin.java | 8 +++---- .../json/mixins/HasExtensionsMixin.java | 4 ++-- .../json/mixins/HasSemanticsMixin.java | 6 +++--- .../json/mixins/IdentifiableMixin.java | 2 +- .../v3/dataformat/json/mixins/KeyMixin.java | 4 ++-- .../mixins/MultiLanguagePropertyMixin.java | 4 ++-- .../json/mixins/OperationMixin.java | 12 +++++------ .../json/mixins/OperationVariableMixin.java | 2 +- .../dataformat/json/mixins/PropertyMixin.java | 5 ++--- .../json/mixins/QualifierMixin.java | 7 +++---- .../v3/dataformat/json/mixins/RangeMixin.java | 3 +-- .../json/mixins/ReferableMixin.java | 9 ++++---- .../json/mixins/ReferenceMixin.java | 7 +++---- .../json/mixins/RelationshipElementMixin.java | 5 ++--- .../json/mixins/SpecificAssetIdMixin.java | 5 ++--- .../json/mixins/SubmodelDescriptorMixin.java | 13 ++++++------ .../SubmodelElementCollectionMixin.java | 5 ++--- .../json/mixins/SubmodelElementListMixin.java | 21 +++++++++---------- .../dataformat/json/mixins/SubmodelMixin.java | 13 ++++++------ .../json/mixins/ValueReferencePairMixin.java | 5 ++--- 31 files changed, 97 insertions(+), 109 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java index 59f49b8de..0cdc361b3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java @@ -22,8 +22,8 @@ public interface AnnotatedRelationshipElementMixin { @JsonProperty("annotations") - public List getAnnotations(); + List getAnnotations(); @JsonProperty("annotations") - public void setAnnotations(List annotations); + void setAnnotations(List annotations); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 3fe313526..8e18c7d83 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -27,32 +27,32 @@ public interface AssetAdministrationShellDescriptorMixin { @JsonProperty("idShort") - public String getIdShort(); + String getIdShort(); @JsonProperty("idShort") - public void setIdShort(String idShort); + void setIdShort(String idShort); @JsonProperty("descriptions") - public List getDescription(); + List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); @JsonProperty("submodelDescriptors") - public List getSubmodelDescriptor(); + List getSubmodelDescriptor(); @JsonProperty("submodelDescriptors") - public void setSubmodelDescriptor(List submodelDescriptor); + void setSubmodelDescriptor(List submodelDescriptor); @JsonProperty("specificAssetIds") - public SpecificAssetId getSpecificAssetId(); + SpecificAssetId getSpecificAssetId(); @JsonProperty("specificAssetIds") - public void setSpecificAssetId(SpecificAssetId specificAssetId); + void setSpecificAssetId(SpecificAssetId specificAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java index 9d5e8c215..9975805ad 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java @@ -22,5 +22,5 @@ public interface AssetAdministrationShellMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetInformation getAssetInformation(); + AssetInformation getAssetInformation(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 1e88c6d7f..a86d56503 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -23,11 +23,11 @@ public interface AssetInformationMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); + AssetKind getAssetKind(); @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + String getGlobalAssetId(); @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java index 7dec06cbe..e64dff105 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java @@ -20,5 +20,5 @@ public interface BlobMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getMimeType(); + String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index f5aadcd1b..529a7aeb4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -22,8 +22,8 @@ public interface ConceptDescriptionMixin { @JsonProperty("isCaseOf") - public List getIsCaseOf(); + List getIsCaseOf(); @JsonProperty("isCaseOf") - public void setIsCaseOfs(List isCaseOf); + void setIsCaseOfs(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 88ec3908d..b3bf5113a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -26,21 +26,21 @@ public interface DataSpecificationIec61360Mixin { @JsonProperty("levelType") - public List getLevelTypes(); + List getLevelTypes(); @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); + void setLevelTypes(List levelTypes); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("preferredName") - public List getPreferredName(); + List getPreferredName(); @JsonProperty("preferredName") - public void setPreferredName(List preferredName); + void setPreferredName(List preferredName); @JsonProperty("unitId") - public Reference getUnitID(); + Reference getUnitId(); public @JsonProperty("unitId") - void setUnitID(Reference unitID); + void setUnitId(Reference unitId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index c6d9a89ef..1c1a2753e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -22,11 +22,11 @@ public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public EntityType getEntityType(); + EntityType getEntityType(); @JsonProperty("globalAssetId") - public String getGlobalAssetID(); + String getGlobalAssetId(); @JsonProperty("globalAssetId") - public void setGlobalAssetID(String globalAssetID); + void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java index 878589f67..7b337e051 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java @@ -27,11 +27,11 @@ public interface EnvironmentMixin { @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Set getAssetAdministrationShells(); + Set getAssetAdministrationShells(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getSubmodels(); + List getSubmodels(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getConceptDescriptions(); + List getConceptDescriptions(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java index f169a29ed..9c84906bd 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java @@ -20,5 +20,5 @@ public interface ExtensionMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getName(); + String getName(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 91b903b08..b5780799d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -20,5 +20,5 @@ public interface FileMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getContentType(); + String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java index ddf50345a..c1fa34770 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java @@ -24,14 +24,14 @@ public interface HasDataSpecificationMixin { @JsonProperty("embeddedDataSpecifications") - public List getEmbeddedDataSpecifications(); + List getEmbeddedDataSpecifications(); @JsonProperty("embeddedDataSpecifications") - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); + void setEmbeddedDataSpecifications(List embeddedDataSpecifications); @JsonProperty("dataSpecifications") - public List getDataSpecifications(); + List getDataSpecifications(); @JsonProperty("dataSpecifications") - public void setDataSpecifications(List dataSpecifications); + void setDataSpecifications(List dataSpecifications); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java index d97c658e3..9f58ad830 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasExtensionsMixin.java @@ -24,8 +24,8 @@ public interface HasExtensionsMixin { @JsonProperty("extension") - public List getExtensions(); + List getExtensions(); @JsonProperty("extension") - public void setExtensions(List extensions); + void setExtensions(List extensions); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java index 6398cc152..c5f02fe74 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java @@ -20,8 +20,8 @@ public interface HasSemanticsMixin { @JsonProperty("semanticId") - public Reference getSemanticID(); + Reference getSemanticId(); - @JsonProperty("semanticId") - public void setSemanticID(Reference semanticID); + @JsonProperty("semanticId") + void setSemanticId(Reference semanticId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java index 301a31bc6..2d203c018 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java @@ -20,5 +20,5 @@ public interface IdentifiableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public String getId(); + String getId(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java index fbbe1f0e2..a600b260c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java @@ -21,8 +21,8 @@ public interface KeyMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public KeyTypes getType(); + KeyTypes getType(); @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValue(); + String getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index cacb010eb..c27011087 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -30,8 +30,8 @@ public interface MultiLanguagePropertyMixin { public void setValue(LangStringTextType value); @JsonProperty("valueId") - public Reference getValueID(); + public Reference getValueId(); @JsonProperty("valueId") - public void setValueID(Reference valueID); + public void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java index 26aefde1d..a62ed8397 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java @@ -22,20 +22,20 @@ public interface OperationMixin { @JsonProperty("inputVariables") - public List getInputVariables(); + List getInputVariables(); @JsonProperty("inputVariables") - public void setInputVariables(List inputVariables); + void setInputVariables(List inputVariables); @JsonProperty("inoutputVariables") - public List getInoutputVariables(); + List getInoutputVariables(); @JsonProperty("inoutputVariables") - public void setInoutputVariables(List inoutputVariables); + void setInoutputVariables(List inoutputVariables); @JsonProperty("outputVariables") - public List getOutputVariables(); + List getOutputVariables(); @JsonProperty("outputVariables") - public void setOutputVariables(List outputVariables); + void setOutputVariables(List outputVariables); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java index 33ca567e1..608df9adb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java @@ -21,5 +21,5 @@ public interface OperationVariableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public SubmodelElement getValue(); + SubmodelElement getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java index 7321e805f..f4fbb6943 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface PropertyMixin { - @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 6cdd8c2a3..a0cea9c50 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -20,13 +20,12 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getType(); + String getType(); @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - void setValueID(Reference valueID); + void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java index 49fdef609..d7b609ac4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface RangeMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValueType(); + String getValueType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java index d93eb2c17..9131120f1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java @@ -22,16 +22,15 @@ import java.util.List; public interface ReferableMixin { - @JsonProperty("description") - public List getDescription(); + List getDescription(); @JsonProperty("description") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayNames); + void setDisplayName(List displayNames); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java index 9105bc8bf..b9be2c816 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java @@ -23,15 +23,14 @@ import java.util.List; public interface ReferenceMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("keys") - public List getKeys(); + List getKeys(); @JsonInclude(JsonInclude.Include.ALWAYS) @JsonProperty("type") - public ReferenceTypes getType(); + ReferenceTypes getType(); @JsonProperty("type") - public void setType(ReferenceTypes type); + void setType(ReferenceTypes type); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java index 04abbe3a3..5bbd6c537 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface RelationshipElementMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getFirst(); + Reference getFirst(); @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getSecond(); + Reference getSecond(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java index 94f435137..6571976b8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface SpecificAssetIdMixin { - @JsonProperty("externalSubjectId") - public Reference getExternalSubjectID(); + Reference getExternalSubjectId(); @JsonProperty("externalSubjectId") - public void setExternalSubjectID(Reference reference); + void setExternalSubjectId(Reference reference); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index faf4b909a..27fe07f07 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -24,22 +24,21 @@ import java.util.List; public interface SubmodelDescriptorMixin { - @JsonProperty("descriptions") - public List getDescription(); + List getDescription(); @JsonProperty("descriptions") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayNames") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayNames") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); @JsonProperty("specificAssetIds") - public SpecificAssetId getSpecificAssetId(); + SpecificAssetId getSpecificAssetId(); @JsonProperty("specificAssetIds") - public void setSpecificAssetId(SpecificAssetId specificAssetId); + void setSpecificAssetId(SpecificAssetId specificAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java index 95cfa1469..bcd6ef9ea 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java @@ -20,10 +20,9 @@ import java.util.Collection; public interface SubmodelElementCollectionMixin { - @JsonProperty("value") - public Collection getValues(); + Collection getValues(); @JsonProperty("value") - public void setValues(Collection values); + void setValues(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 5ca0161db..d1f78dd72 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -26,36 +26,35 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { - @JsonInclude(JsonInclude.Include.NON_DEFAULT) @JsonProperty("orderRelevant") - public boolean getOrdered(); + boolean getOrdered(); @JsonInclude(JsonInclude.Include.NON_DEFAULT) @JsonProperty("orderRelevant") - public void setOrdered(boolean orderRelevant); + void setOrdered(boolean orderRelevant); @JsonProperty("semanticIdListElement") - public Reference getSemanticIdListElement(); + Reference getSemanticIdListElement(); @JsonProperty("semanticIdListElement") - public void setSemanticIdListElement(Reference semanticIdListElement); + void setSemanticIdListElement(Reference semanticIdListElement); @JsonProperty("typeValueListElement") - public AasSubmodelElements getTypeValueListElement(); + AasSubmodelElements getTypeValueListElement(); @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AasSubmodelElements typeValueListElement); + void setTypeValueListElement(AasSubmodelElements typeValueListElement); @JsonProperty("valueTypeListElement") - public DataTypeDefXsd getValueTypeListElement(); + DataTypeDefXsd getValueTypeListElement(); @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") - public Collection getValues(); + Collection getValues(); @JsonProperty("value") - public void setValues(Collection values); + void setValues(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index d1a7f64a3..f39588dc4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -23,22 +23,21 @@ import java.util.List; public interface SubmodelMixin { - @JsonProperty("idShort") - public String getIdShort(); + String getIdShort(); @JsonProperty("idShort") - public void setIdShort(String idShort); + void setIdShort(String idShort); @JsonProperty("description") - public List getDescription(); + List getDescription(); @JsonProperty("description") - public void setDescription(List description); + void setDescription(List description); @JsonProperty("displayName") - public List getDisplayName(); + List getDisplayName(); @JsonProperty("displayName") - public void setDisplayName(List displayName); + void setDisplayName(List displayName); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java index 163467672..bc5873f14 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java @@ -19,10 +19,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface ValueReferencePairMixin { - @JsonProperty("valueId") - public Reference getValueID(); + Reference getValueId(); @JsonProperty("valueId") - public void setValueID(Reference valueID); + void setValueId(Reference valueId); } From 6326daebb74dd7cde5630d7eb53feab023f0cf90 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 10:25:17 +0200 Subject: [PATCH 25/91] Revert some changes in the comments --- .../digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java | 1 - .../digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java | 1 - 2 files changed, 2 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 0b0aa33d9..d2ce12523 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index f0456b2ee..095c964e2 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 74811fb816e1a546528cdc352f19359d33c905fa Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 11:30:04 +0200 Subject: [PATCH 26/91] Adapt dataformat-core --- .../v3/dataformat/core/util/AasUtils.java | 1 - .../aas4j/v3/dataformat/core/AASFull.java | 173 +++++++++++------- .../aas4j/v3/dataformat/core/AASSimple.java | 44 ++++- .../v3/dataformat/core/CustomProperty.java | 17 +- .../dataformat/core/EnumDeserializerTest.java | 28 ++- .../dataformat/core/EnumSerializerTest.java | 5 +- 6 files changed, 180 insertions(+), 88 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index a4ba8d154..a7d12cd1a 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index 9133944d1..5a8e8536a 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -19,9 +19,54 @@ import java.util.Arrays; import java.util.Base64; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; public class AASFull { @@ -1761,75 +1806,75 @@ public static ConceptDescription createConceptDescription3() { public static ConceptDescription createConceptDescription4() { return new DefaultConceptDescription.Builder() - .idShort("TestSpec_01") - .id("http://acplt.org/DataSpecifciations/Example/Identification") - .administration(new DefaultAdministrativeInformation.Builder() - .version("0") - .revision("9") - .build()) - .isCaseOf(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() - .dataSpecification(new DefaultReference.Builder() - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) + .idShort("TestSpec_01") + .id("http://acplt.org/DataSpecifciations/Example/Identification") + .administration(new DefaultAdministrativeInformation.Builder() + .version("0") + .revision("9") .build()) - .build()) - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName(Arrays.asList( - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), - new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() - )) - .dataType(DataTypeIec61360.REAL_MEASURE) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) - .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) - .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) - .unit("SpaceUnit") - .unitId(new DefaultReference.Builder() + .isCaseOf(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/Units/SpaceUnit") - .build()) + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ReferenceElements/ConceptDescriptionX") + .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") - .symbol("SU") - .valueFormat("string") - .value("TEST") - .levelType(new DefaultLevelType.Builder().max(true).build()) - .valueList(new DefaultValueList.Builder() - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId") - .valueId(new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId") - .build()) + .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() + .dataSpecification(new DefaultReference.Builder() .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) - .build()) - .valueReferencePairs(new DefaultValueReferencePair.Builder() - .value("http://acplt.org/ValueId/ExampleValueId2") - .valueId(new DefaultReference.Builder() .keys(new DefaultKey.Builder() - .type(KeyTypes.GLOBAL_REFERENCE) - .value("http://acplt.org/ValueId/ExampleValueId2") - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) + .type(KeyTypes.GLOBAL_REFERENCE) + .value(AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360) + .build()) + .build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName(Arrays.asList( + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("Test Specification").language("de").build(), + new DefaultLangStringPreferredNameTypeIec61360.Builder().text("TestSpecification").language("en-us").build() + )) + .dataType(DataTypeIec61360.REAL_MEASURE) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("Dies ist eine Data Specification für Testzwecke").language("de").build()) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder().text("This is a DataSpecification for testing purposes").language("en-us").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("Test Spec").language("de").build()) + .shortName(new DefaultLangStringShortNameTypeIec61360.Builder().text("TestSpec").language("en-us").build()) + .unit("SpaceUnit") + .unitId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/Units/SpaceUnit") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .sourceOfDefinition("http://acplt.org/DataSpec/ExampleDef") + .symbol("SU") + .valueFormat("string") + .value("TEST") + .levelType(new DefaultLevelType.Builder().max(true).build()) + .valueList(new DefaultValueList.Builder() + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .build()) + .valueReferencePairs(new DefaultValueReferencePair.Builder() + .value("http://acplt.org/ValueId/ExampleValueId2") + .valueId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("http://acplt.org/ValueId/ExampleValueId2") + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) + .build()) + .build()) .build()) - .build()) .build()) - .build()) - .build()) - .build(); + .build(); } public static Environment createEnvironment() { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java index 4234ea749..340261457 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASSimple.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +15,36 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; - import java.util.Arrays; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; public class AASSimple { @@ -167,12 +191,12 @@ public static AssetAdministrationShell createAAS() { .build()) .submodels( new DefaultReference.Builder() - .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL) - .value(SUBMODEL_DOCUMENTATION_ID) - .build()) - .type(ReferenceTypes.EXTERNAL_REFERENCE) - .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(SUBMODEL_DOCUMENTATION_ID) + .build()) + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .build()) .build(); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java index 055ba67ba..8f4230cb3 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/CustomProperty.java @@ -28,6 +28,8 @@ public class CustomProperty implements Property { protected List dataSpecifications; + protected ModellingKind kind; + protected Reference semanticId; protected String value; @@ -56,7 +58,7 @@ protected CustomProperty() { @Override public int hashCode() { return Objects.hash(new Object[] { this.valueType, this.value, this.valueId, this.category, this.description, - this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications, this.kind,*/ + this.displayName, this.idShort, this.qualifiers, /* this.embeddedDataSpecifications,*/ this.kind, this.semanticId }); } @@ -70,13 +72,16 @@ public boolean equals(Object obj) { return false; } else { CustomProperty other = (CustomProperty) obj; - return Objects.equals(this.valueType, other.valueType) && Objects.equals(this.value, other.value) - && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.category, other.category) + return Objects.equals(this.valueType, other.valueType) + && Objects.equals(this.value, other.value) + && Objects.equals(this.valueId, other.valueId) + && Objects.equals(this.category, other.category) && Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) - && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.qualifiers, other.qualifiers) - // TODO && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) - //&& Objects.equals(this.kind, other.kind) + && Objects.equals(this.idShort, other.idShort) + && Objects.equals(this.qualifiers, other.qualifiers) + && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) + && Objects.equals(this.kind, other.kind) && Objects.equals(this.semanticId, other.semanticId); } } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 3ad801789..f5a6b5567 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -16,8 +16,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; +import java.io.IOException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; @@ -27,7 +27,8 @@ import org.junit.Test; import org.mockito.Mockito; -import java.io.IOException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; public class EnumDeserializerTest { @@ -40,8 +41,24 @@ public void setUp() { deserializationContextMock = Mockito.mock(DeserializationContext.class); } + @Test + public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); + } + + @Test + public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { + final String name = "ANY_ENUM"; + Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); + } + @Test - public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { + public void whenSerializingEnum_usingDataTypeIEC61360_shouldReturnUpperCase() { assertDeserialization("BOOLEAN", DataTypeIec61360.BOOLEAN); assertDeserialization("DATE", DataTypeIec61360.DATE); assertDeserialization("INTEGER_CURRENCY", DataTypeIec61360.INTEGER_CURRENCY); @@ -70,7 +87,8 @@ public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertDeserialization("off", StateOfEvent.OFF); } - private void assertDeserialization(String value, Enum expected) { + @SuppressWarnings("rawtypes") + private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index c080e8cf6..33cae0017 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -69,13 +69,13 @@ public void whenSerializingEnum_usingDataTypeIec61360_shouldReturnUpperCase() { } @Test - public void whenSerializingEnum_usingDirection_shouldReturnUpperCase() { + public void whenSerializingEnum_usingDirection_shouldReturnLowerCase() { assertSerialization(Direction.INPUT, "input"); assertSerialization(Direction.OUTPUT, "output"); } @Test - public void whenSerializingEnum_usingStateOfEvent_shouldReturnUpperCase() { + public void whenSerializingEnum_usingStateOfEvent_shouldReturnLowerCase() { assertSerialization(StateOfEvent.ON, "on"); assertSerialization(StateOfEvent.OFF, "off"); } @@ -85,6 +85,7 @@ public void whenSerializingEnum_usingModelingKind_shouldReturnCamelCase() { assertSerialization(ModellingKind.INSTANCE, "Instance"); assertSerialization(ModellingKind.TEMPLATE, "Template"); } + private void assertSerialization(Enum value, String expected) { this.serializationOutput.setLength(0); try { From 382fd3d3c6d45667b66391731181db63e101950f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 13:48:49 +0200 Subject: [PATCH 27/91] Adapt dataformat-json project --- .../v3/dataformat/json/mixins/ConceptDescriptionMixin.java | 2 +- .../dataformat/json/mixins/MultiLanguagePropertyMixin.java | 6 +++--- .../json/mixins/SubmodelElementCollectionMixin.java | 5 +++-- .../v3/dataformat/json/mixins/SubmodelElementListMixin.java | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java index 529a7aeb4..77e2b8f47 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java @@ -25,5 +25,5 @@ public interface ConceptDescriptionMixin { List getIsCaseOf(); @JsonProperty("isCaseOf") - void setIsCaseOfs(List isCaseOf); + void setIsCaseOf(List isCaseOf); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java index c27011087..a26009306 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java @@ -24,13 +24,13 @@ public interface MultiLanguagePropertyMixin { @JsonProperty("value") - public List getValue(); + List getValue(); @JsonProperty("value") - public void setValue(LangStringTextType value); + void setValue(LangStringTextType value); @JsonProperty("valueId") - public Reference getValueId(); + Reference getValueId(); @JsonProperty("valueId") public void setValueId(Reference valueId); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java index bcd6ef9ea..0b8cc0744 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java @@ -20,9 +20,10 @@ import java.util.Collection; public interface SubmodelElementCollectionMixin { + @JsonProperty("value") - Collection getValues(); + public Collection getValue(); @JsonProperty("value") - void setValues(Collection values); + public void setValue(Collection values); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index d1f78dd72..931547130 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -53,8 +53,8 @@ public interface SubmodelElementListMixin { void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); @JsonProperty("value") - Collection getValues(); + Collection getValue(); @JsonProperty("value") - void setValues(Collection values); -} + void setValue(Collection value); +} \ No newline at end of file From 5c7bff07acaea8a15f043e8b09476109b705ec4e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 7 Jul 2023 13:53:47 +0200 Subject: [PATCH 28/91] Update PropertyMixin.java --- .../dataformat/xml/mixins/PropertyMixin.java | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java index 6f4d57d08..f91d8340a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java @@ -15,73 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import java.util.List; - /** * * @author schnicke * */ -//@JsonPropertyOrder({"category", "idShort", "displayName", "description", "checksum", "valueId", "valueType", "value" }) -@JsonPropertyOrder({ - "hasExtensions", "category", "idShort", "displayName", "description", "checksum", // --> Referable - "kind", // --> HasKind - "semanticId", "supplementalSemanticIds", "reference", // --> HasSemantics - "qualifier", // --> Qualifiable - "dataSpecifications", "embeddedDataSpecifications", // --> HasDataSpecifications - "orderRelevant", "semanticIdListElement", "typeValueListElement", "valueTypeListElement", // --> SME-List - "valueType", "value", "valueId" // --> Property - , "statements", "entityType", "globalAssetId", "specificAssetId" // --> Entity - , "first", "second", "annotations" // --> (Annotated)RelationsShipElement - , "inputVariables", "outputVariables", "inoutputVariables" // --> Operation - , "observed","direction","state","messageTopic","messageBroker","lastUpdate","minInterval","maxInterval" // --> BasicEventElement - , "min", "max" // Range -}) public interface PropertyMixin { - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") - void setCategory(String category); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "category") - String getCategory(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") - void setIdShort(String idShort); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "idShort") - String getIdShort(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonDeserialize(using = LangStringsNameTypeDeserializer.class) - List getDisplayName(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "displayName") - @JsonSerialize(using = LangStringsNameTypeSerializer.class) - void setDisplayName(List displayNames); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonSerialize(using = LangStringsTextTypeSerializer.class) - List getDescription(); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "description") - @JsonDeserialize(using = LangStringsTextTypeDeserializer.class) - void setDescription(List descriptions); - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") void setValueId(Reference valueId); - - @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "valueId") - Reference getValueId(); } From 4fa5d0f6c8d751cd3941897bb8d46cee02d96cc3 Mon Sep 17 00:00:00 2001 From: tschultebahrenberg-sap <137792054+tschultebahrenberg-sap@users.noreply.github.com> Date: Thu, 27 Jul 2023 09:11:12 +0200 Subject: [PATCH 29/91] fix: enable more than one data specification content (#5) * test: re-activate JSON de-/serialization tests for DataSpecficationPhysicalUnit * test: XML de-/serialization of DataSpecificationPhysicalUnit * refactor: update comments * refactor: remove unnecessary code --------- Co-authored-by: Thomas Schulte-Bahrenberg --- .../json/JsonReferableDeserializerTest.java | 24 +- .../json/JsonReferableSerializerTest.java | 1 - .../v3/dataformat/json/util/Examples.java | 45 ++-- ...mbeddedDataSpecificationsDeserializer.java | 34 ++- .../EmbeddedDataSpecificationSerializer.java | 17 +- .../v3/model/DataSpecificationContent.java | 3 +- .../model/DataSpecificationPhysicalUnit.java | 99 ++++++++ .../DataSpecificationPhysicalUnitBuilder.java | 104 ++++++++ .../DefaultDataSpecificationPhysicalUnit.java | 233 ++++++++++++++++++ 9 files changed, 512 insertions(+), 48 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 68ef1d473..9b1011540 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -15,22 +15,26 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import static org.junit.Assert.assertEquals; - import java.io.IOException; +import java.io.InputStream; import java.util.Collections; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import static org.junit.Assert.assertEquals; public class JsonReferableDeserializerTest { @@ -97,4 +101,14 @@ public void testReadEmptyReferableList() throws DeserializationException { List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); assertEquals(emptyList, deserialized); } + + @Test + public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { + ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; + Object expected = exampleData.getModel(); + try (InputStream fileContent = exampleData.fileContentStream()) { + Object actual = new JsonDeserializer().readReferable(fileContent, (Class) exampleData.getModel().getClass()); + Assert.assertEquals(expected, actual); + } + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 882958cd0..ad7b51e99 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -48,7 +48,6 @@ public void testSerializeAASs() throws IOException, SerializationException, JSON } @Test - @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 7cf92fa72..e2d6deb90 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -76,6 +76,7 @@ public class Examples { public static final ExampleData CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT = ExampleData.of( new DefaultConceptDescription.Builder() .id("https://example.org/ConceptDescription") + .category("PROPERTY") .embeddedDataSpecifications(new DefaultEmbeddedDataSpecification.Builder() .dataSpecification(new DefaultReference.Builder() .type(ReferenceTypes.EXTERNAL_REFERENCE) @@ -84,28 +85,28 @@ public class Examples { .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02") .build()) .build()) -// .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() -// .conversionFactor("1.0") -// .eceCode("ece-code") -// .eceName("ece-name") -// .definition(new DefaultLangString.Builder() -// .language("en") -// .text("definition-en") -// .build()) -// .definition(new DefaultLangString.Builder() -// .language("de") -// .text("definition-de") -// .build()) -// .nistName("nist-name") -// .dinNotation("din-notation") -// .siName("si-name") -// .registrationAuthorityId("registration-authority-id") -// .siNotation("si-notation") -// .sourceOfDefinition("source-of-definition") -// .supplier("supplier") -// .unitName("unit-name") -// .unitSymbol("unit-symbol") -// .build()) + .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() + .conversionFactor("1.0") + .eceCode("ece-code") + .eceName("ece-name") + .definition(new DefaultLangStringTextType.Builder() + .language("en") + .text("definition-en") + .build()) + .definition(new DefaultLangStringTextType.Builder() + .language("de") + .text("definition-de") + .build()) + .nistName("nist-name") + .dinNotation("din-notation") + .siName("si-name") + .registrationAuthorityId("registration-authority-id") + .siNotation("si-notation") + .sourceOfDefinition("source-of-definition") + .supplier("supplier") + .unitName("unit-name") + .unitSymbol("unit-symbol") + .build()) .build()) .build(), "ConceptDescription-DataSpecificationPhysicalUnit.json"); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 1deec93b2..f4314f48c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -16,23 +16,29 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import java.io.IOException; +import java.util.Objects; +import java.util.Set; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; - +import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { +import static java.util.Spliterator.ORDERED; +import static java.util.Spliterators.spliteratorUnknownSize; +import static java.util.stream.StreamSupport.stream; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper.getDefaultImplementation; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.DeserializationHelper.createInstanceFromNode; - private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { @Override - public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public DataSpecificationContent deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -42,13 +48,17 @@ public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationC } - private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); - return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); - } + private DataSpecificationContent createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + final Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); - private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); + Pair> typeMapping = stream(spliteratorUnknownSize(node.fieldNames(), ORDERED), false) + .flatMap(fieldName -> subtypes.stream().map(subtype -> (subtype.getSimpleName().equalsIgnoreCase(fieldName)) ? Pair.of(fieldName, subtype) : null)) + .filter(Objects::nonNull) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("No subtype could be determined for creating EmbeddedDataSpecifications from content!")); + JsonNode nodeContent = node.get(typeMapping.getKey()); + Class instanceType = getDefaultImplementation(typeMapping.getValue()); + return (DataSpecificationContent) createInstanceFromNode(parser, nodeContent, instanceType); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index 1208a07d6..4a5868ed5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -17,13 +17,15 @@ import java.io.IOException; - +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; + +import static org.apache.commons.lang3.StringUtils.uncapitalize; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper.getModelType; /** @@ -31,23 +33,24 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { @Override - public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationContent data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } + String fieldName = uncapitalize(getModelType(data.getClass())); generator.writeStartObject(); - generator.writeObjectField("dataSpecificationIec61360", data); + generator.writeObjectField(fieldName, data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, - TypeSerializer typedSerializer) throws IOException, JsonProcessingException { + public void serializeWithType(DataSpecificationContent data, JsonGenerator generator, SerializerProvider provider, + TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index e2933c187..815698216 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -26,7 +26,8 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DataSpecificationIec61360.class), + @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..9293aee49 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; + + +/** + * Content of data specification template for concept descriptions for properties, values and value + * lists conformant to IEC 61360. + */ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) +}) +public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/conversionFactor") + String getConversionFactor(); + + void setConversionFactor(String conversionFactor); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/dinNotation") + String getDinNotation(); + + void setDinNotation(String dinNotation); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceCode") + String getEceCode(); + + void setEceCode(String eceCode); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceName") + String getEceName(); + + void setEceName(String eceName); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/nistName") + String getNistName(); + + void setNistName(String nistName); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/registrationAuthorityId") + String getRegistrationAuthorityId(); + + void setRegistrationAuthorityId(String registrationAuthorityId); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siName") + String getSiName(); + + void setSiName(String siName); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siNotation") + String getSiNotation(); + + void setSiNotation(String siNotation); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/sourceOfDefinition") + String getSourceOfDefinition(); + + void setSourceOfDefinition(String sourceOfDefinition); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/supplier") + String getSupplier(); + + void setSupplier(String supplier); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitName") + String getUnitName(); + + void setUnitName(String unitName); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitSymbol") + String getUnitSymbol(); + + void setUnitSymbol(String unitSymbol); + + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/definition") + List getDefinition(); + + void setDefinition(List definition); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java new file mode 100644 index 000000000..1cebc09f8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + + +public abstract class DataSpecificationPhysicalUnitBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for conversionFactor + * + * @param conversionFactor desired conversionFactor to be set + * @return Builder object with new value for conversionFactor + */ + public B conversionFactor(String conversionFactor) { + getBuildingInstance().setConversionFactor(conversionFactor); + return getSelf(); + } + + public B dinNotation(String dinNotation) { + getBuildingInstance().setDinNotation(dinNotation); + return getSelf(); + } + + public B eceCode(String eceCode) { + getBuildingInstance().setEceCode(eceCode); + return getSelf(); + } + + public B eceName(String eceName) { + getBuildingInstance().setEceName(eceName); + return getSelf(); + } + + public B nistName(String nistName) { + getBuildingInstance().setNistName(nistName); + return getSelf(); + } + + public B registrationAuthorityId(String registrationAuthorityId) { + getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); + return getSelf(); + } + + public B siName(String siName) { + getBuildingInstance().setSiName(siName); + return getSelf(); + } + + public B siNotation(String siNotation) { + getBuildingInstance().setSiNotation(siNotation); + return getSelf(); + } + + public B sourceOfDefinition(String sourceOfDefinition) { + getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); + return getSelf(); + } + + public B supplier(String supplier) { + getBuildingInstance().setSupplier(supplier); + return getSelf(); + } + + public B unitName(String unitName) { + getBuildingInstance().setUnitName(unitName); + return getSelf(); + } + + public B unitSymbol(String unitSymbol) { + getBuildingInstance().setUnitSymbol(unitSymbol); + return getSelf(); + } + + public B definition(LangStringTextType definition) { + List definitionList = getBuildingInstance().getDefinition(); + if (definitionList == null) { + definitionList = new ArrayList<>(); + getBuildingInstance().setDefinition(definitionList); + } + definitionList.add(definition); + return getSelf(); + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java new file mode 100644 index 000000000..b24b826eb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.List; +import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; + + +/** + * Default implementation of org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit + */ + +@IRI("aas:DefaultDataSpecificationPhysicalUnit") +public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/conversionFactor") + protected String conversionFactor; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/dinNotation") + protected String dinNotation; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceCode") + protected String eceCode; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceName") + protected String eceName; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/nistName") + protected String nistName; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/registrationAuthorityId") + protected String registrationAuthorityId; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siName") + protected String siName; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siNotation") + protected String siNotation; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/sourceOfDefinition") + protected String sourceOfDefinition; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/supplier") + protected String supplier; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitName") + protected String unitName; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitSymbol") + protected String unitSymbol; + @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/definition") + protected List definition; + + public DefaultDataSpecificationPhysicalUnit() { + } + + @Override + public int hashCode() { + return Objects.hash(this.conversionFactor); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; + return Objects.equals(this.conversionFactor, other.conversionFactor); + } + } + + @Override + public String getConversionFactor() { + return conversionFactor; + } + + @Override + public void setConversionFactor(String conversionFactor) { + this.conversionFactor = conversionFactor; + } + + @Override + public String getDinNotation() { + return dinNotation; + } + + @Override + public void setDinNotation(String dinNotation) { + this.dinNotation = dinNotation; + } + + @Override + public String getEceCode() { + return eceCode; + } + + @Override + public void setEceCode(String eceCode) { + this.eceCode = eceCode; + } + + @Override + public String getEceName() { + return eceName; + } + + @Override + public void setEceName(String eceName) { + this.eceName = eceName; + } + + @Override + public String getNistName() { + return nistName; + } + + @Override + public void setNistName(String nistName) { + this.nistName = nistName; + } + + @Override + public String getRegistrationAuthorityId() { + return registrationAuthorityId; + } + + @Override + public void setRegistrationAuthorityId(String registrationAuthorityId) { + this.registrationAuthorityId = registrationAuthorityId; + } + + @Override + public String getSiName() { + return siName; + } + + @Override + public void setSiName(String siName) { + this.siName = siName; + } + + @Override + public String getSiNotation() { + return siNotation; + } + + @Override + public void setSiNotation(String siNotation) { + this.siNotation = siNotation; + } + + @Override + public String getSourceOfDefinition() { + return sourceOfDefinition; + } + + @Override + public void setSourceOfDefinition(String sourceOfDefinition) { + this.sourceOfDefinition = sourceOfDefinition; + } + + @Override + public String getSupplier() { + return supplier; + } + + @Override + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + @Override + public String getUnitName() { + return unitName; + } + + @Override + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + @Override + public String getUnitSymbol() { + return unitSymbol; + } + + @Override + public void setUnitSymbol(String unitSymbol) { + this.unitSymbol = unitSymbol; + } + + @Override + public List getDefinition() { + return definition; + } + + @Override + public void setDefinition(List definition) { + this.definition = definition; + } + + public String toString() { + return String.format( + "DefaultDataSpecificationPhysicalUnit (conversionFactor=%s)", + this.conversionFactor); + } + + /** + * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. + */ + public static class Builder extends DataSpecificationPhysicalUnitBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { + return new DefaultDataSpecificationPhysicalUnit(); + } + } +} From d77046bb4592cf4372aac0fc0a7a2f295ce787e4 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 10:19:42 +0200 Subject: [PATCH 30/91] add copyright header --- .../aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java | 1 + .../aas4j/v3/dataformat/json/JsonReferableSerializerTest.java | 1 + .../deserialization/EmbeddedDataSpecificationsDeserializer.java | 1 + .../xml/serialization/EmbeddedDataSpecificationSerializer.java | 1 + 4 files changed, 4 insertions(+) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 9b1011540..8521e220f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index ad7b51e99..8c75a343d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index f4314f48c..75418cef3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index 4a5868ed5..d6993662f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 953c7f45638f4a5ed972c131d3a7c2fc157dddb0 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 10:54:36 +0200 Subject: [PATCH 31/91] fix v3.0.1 compliance of descriptors --- ...setAdministrationShellDescriptorMixin.java | 8 +++--- .../json/mixins/SubmodelDescriptorMixin.java | 8 +++--- ...sonSubmodelDescriptorDeserializerTest.java | 2 +- .../assetAdministrationShellDescriptor.json | 12 ++++---- .../test/resources/submodelDescriptor.json | 6 ++-- .../AssetAdministrationShellDescriptor.java | 13 ++++----- .../aas4j/v3/model/SubmodelDescriptor.java | 12 ++++---- ...tAdministrationShellDescriptorBuilder.java | 6 ++-- .../builder/SubmodelDescriptorBuilder.java | 6 ++-- ...ultAssetAdministrationShellDescriptor.java | 27 ++++++++++++------ .../model/impl/DefaultSubmodelDescriptor.java | 28 +++++++++++++------ 11 files changed, 75 insertions(+), 53 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 8e18c7d83..497a74b00 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -32,16 +32,16 @@ public interface AssetAdministrationShellDescriptorMixin { @JsonProperty("idShort") void setIdShort(String idShort); - @JsonProperty("descriptions") + @JsonProperty("description") List getDescription(); - @JsonProperty("descriptions") + @JsonProperty("description") void setDescription(List description); - @JsonProperty("displayNames") + @JsonProperty("displayName") List getDisplayName(); - @JsonProperty("displayNames") + @JsonProperty("displayName") void setDisplayName(List displayName); @JsonProperty("submodelDescriptors") diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 27fe07f07..842cbd6e9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -24,16 +24,16 @@ import java.util.List; public interface SubmodelDescriptorMixin { - @JsonProperty("descriptions") + @JsonProperty("description") List getDescription(); - @JsonProperty("descriptions") + @JsonProperty("description") void setDescription(List description); - @JsonProperty("displayNames") + @JsonProperty("displayName") List getDisplayName(); - @JsonProperty("displayNames") + @JsonProperty("displayName") void setDisplayName(List displayName); @JsonProperty("specificAssetIds") diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index 2bf14bbb4..3daf4d3e3 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -35,7 +35,7 @@ public static SubmodelDescriptor getDefaultSubmodelDescriptor () { .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) .description(TestDataHelper.DEFAULT_DESCRIPTION) .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) .idShort(TestDataHelper.DEFAULT_ID_SHORT) .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json index 059daa7b0..1b8414a72 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -27,16 +27,16 @@ } } ] }, - "descriptions" : [ { + "description" : [ { "language" : "en", "text" : "defaultDescription" } ], - "displayNames" : [ { + "displayName" : [ { "language" : "en", "text" : "defaultDisplayName" } ], "idShort" : "defaultIdShort", - "identification" : "identification", + "id" : "identification", "globalAssetId" : { "keys" : [ { "type" : "AssetAdministrationShell", @@ -91,16 +91,16 @@ } } ] }, - "descriptions" : [ { + "description" : [ { "language" : "en", "text" : "defaultDescription" } ], - "displayNames" : [ { + "displayName" : [ { "language" : "en", "text" : "defaultDisplayName" } ], "idShort" : "defaultIdShort", - "identification" : "identification", + "id" : "identification", "semanticId" : { "keys" : [ { "type" : "GlobalReference", diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json index 164daa569..9c0bcb1ee 100644 --- a/dataformat-json/src/test/resources/submodelDescriptor.json +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -27,16 +27,16 @@ } } ] }, - "descriptions" : [ { + "description" : [ { "language" : "en", "text" : "defaultDescription" } ], - "displayNames" : [ { + "displayName" : [ { "language" : "en", "text" : "defaultDisplayName" } ], "idShort" : "defaultIdShort", - "identification" : "identification", + "id" : "identification", "semanticId" : { "keys" : [ { "type" : "GlobalReference", diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java index 8fcb1be17..ca6a03bb2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2023 SAP SE * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except @@ -116,20 +115,20 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id * * @return Returns the String for the property identification. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") - String getIdentification(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + String getId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id * - * @param identification desired value for the property identification. + * @param id desired value for the property identification. */ - void setIdentification(String identification); + void setId(String id); /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java index b4173aa09..14e283792 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -98,20 +98,20 @@ public interface SubmodelDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id * * @return Returns the String for the property identification. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") - String getIdentification(); + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + String getId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification + * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id * - * @param identification desired value for the property identification. + * @param id desired value for the property identification. */ - void setIdentification(String identification); + void setId(String id); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java index 950eb0017..97e87ccbe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -69,11 +69,11 @@ public B idShort(String idShort) { /** * This function allows setting a value for identification * - * @param identification desired value to be set + * @param id desired value to be set * @return Builder object with new value for identification */ - public B identification(String identification) { - getBuildingInstance().setIdentification(identification); + public B identification(String id) { + getBuildingInstance().setId(id); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java index 178fcb391..cbc2330a1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -74,11 +74,11 @@ public B idShort(String idShort) { /** * This function allows setting a value for identification * - * @param identification desired value to be set + * @param id desired value to be set * @return Builder object with new value for identification */ - public B identification(String identification) { - getBuildingInstance().setIdentification(identification); + public B id(String id) { + getBuildingInstance().setId(id); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index 634590eab..4237dd54b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -41,8 +41,8 @@ public class DefaultAssetAdministrationShellDescriptor implements AssetAdministr @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/identification") - protected String identification; + @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/id") + protected String id; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") protected Reference globalAssetId; @@ -63,7 +63,7 @@ public int hashCode() { this.description, this.displayName, this.idShort, - this.identification, + this.id, this.globalAssetId, this.specificAssetId, this.submodelDescriptor, @@ -84,7 +84,7 @@ public boolean equals(Object obj) { Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.identification, other.identification) && + Objects.equals(this.id, other.id) && Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetId, other.specificAssetId) && Objects.equals(this.submodelDescriptor, other.submodelDescriptor) && @@ -133,13 +133,13 @@ public void setIdShort(String idShort) { } @Override - public String getIdentification() { - return identification; + public String getId() { + return id; } @Override - public void setIdentification(String identification) { - this.identification = identification; + public void setId(String id) { + this.id = id; } @Override @@ -183,6 +183,17 @@ public void setEndpoints(List endpoints) { this.endpoints = endpoints; } + + public String toString() { + return String.format( + "DefaultAssetAdministrationShellDescriptor (" + "id=%s," + + "description=%s," + + "displayName=%s," + + "submodelDescriptor=%s," + + ")", + this.id, this.description, this.displayName, this.submodelDescriptor); + } + /** * This builder class can be used to construct a DefaultAssetAdministrationShellDescriptor bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java index 0c40ea39d..86a5b2184 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -46,8 +46,8 @@ public class DefaultSubmodelDescriptor implements SubmodelDescriptor { @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") protected String idShort; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/identification") - protected String identification; + @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + protected String id; @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") protected Reference semanticId; @@ -61,7 +61,7 @@ public int hashCode() { this.description, this.displayName, this.idShort, - this.identification, + this.id, this.semanticId, this.endpoints); } @@ -80,7 +80,7 @@ public boolean equals(Object obj) { Objects.equals(this.description, other.description) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.identification, other.identification) && + Objects.equals(this.id, other.id) && Objects.equals(this.semanticId, other.semanticId) && Objects.equals(this.endpoints, other.endpoints); } @@ -127,13 +127,13 @@ public void setIdShort(String idShort) { } @Override - public String getIdentification() { - return identification; + public String getId() { + return id; } @Override - public void setIdentification(String identification) { - this.identification = identification; + public void setId(String id) { + this.id = id; } @Override @@ -156,6 +156,18 @@ public void setEndpoints(List endpoints) { this.endpoints = endpoints; } + public String toString() { + return String.format( + "DefaultSubmodel (" + "id=%s," + + "endpoints=%s," + + "displayName=%s," + + "description=%s," + + "endpoints=%s," + + ")", + this.id, this.endpoints, this.displayName, this.description, this.endpoints); + } + + /** * This builder class can be used to construct a DefaultSubmodelDescriptor bean. */ From fff595c79bb2cfe97ac772bd7c0d41b689a0da7d Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 11:33:04 +0200 Subject: [PATCH 32/91] fix v3.0.1 compliance of descriptors --- ...setAdministrationShellDescriptorMixin.java | 4 +- .../json/mixins/SubmodelDescriptorMixin.java | 6 --- ...rationShellDescriptorDeserializerTest.java | 4 +- .../v3/dataformat/json/TestDataHelper.java | 13 ++++--- .../assetAdministrationShellDescriptor.json | 38 +++++++++---------- .../test/resources/submodelDescriptor.json | 13 ++++--- .../AssetAdministrationShellDescriptor.java | 8 ++-- .../aas4j/v3/model/ProtocolInformation.java | 16 ++++---- ...tAdministrationShellDescriptorBuilder.java | 8 ++-- .../builder/ProtocolInformationBuilder.java | 10 +++-- ...ultAssetAdministrationShellDescriptor.java | 20 +++++----- .../impl/DefaultProtocolInformation.java | 23 +++++------ 12 files changed, 84 insertions(+), 79 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java index 497a74b00..a503d4de8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java @@ -51,8 +51,8 @@ public interface AssetAdministrationShellDescriptorMixin { void setSubmodelDescriptor(List submodelDescriptor); @JsonProperty("specificAssetIds") - SpecificAssetId getSpecificAssetId(); + List getSpecificAssetIds(); @JsonProperty("specificAssetIds") - void setSpecificAssetId(SpecificAssetId specificAssetId); + void setSpecificAssetIds(List specificAssetIds); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 842cbd6e9..86bf6f300 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -35,10 +35,4 @@ public interface SubmodelDescriptorMixin { @JsonProperty("displayName") void setDisplayName(List displayName); - - @JsonProperty("specificAssetIds") - SpecificAssetId getSpecificAssetId(); - - @JsonProperty("specificAssetIds") - void setSpecificAssetId(SpecificAssetId specificAssetId); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index 0422c2e2d..fd950096c 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -53,9 +53,9 @@ public static AssetAdministrationShellDescriptor createAasDescriptor() { .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) .identification(TestDataHelper.DEFAULT_IDENTIFICATION) .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .specificAssetId(specificAssetId) + .specificAssetIds(List.of(specificAssetId)) .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .globalAssetId(TestDataHelper.createReference(ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultGlobalAssetId")) + .globalAssetId("defaultGlobalAssetId") .submodelDescriptor(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 8f1ab22d8..af0c2dc41 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -18,14 +18,17 @@ public class TestDataHelper { .build(); public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder().build()) + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName( + new DefaultLangStringPreferredNameTypeIec61360.Builder().language("en").text("defaultPreferredName").build()) + .build()) .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = new DefaultAdministrativeInformation.Builder() .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) - .revision("defaultAdministrativeInformationRevisionValue") - .version("defaultAdministrativeInformationVersionValue").build(); + .revision("1") + .version("1").build(); public static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); @@ -64,9 +67,9 @@ public static Key createKey(KeyTypes type, String value) { public static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { return new DefaultProtocolInformation.Builder() - .endpointAddress("defaultEndpointAddress") + .href("defaultEndpointAddress") .endpointProtocol("defaultEndpointProtocol") - .endpointProtocolVersion("defaultEndpointProtocolVersion") + .endpointProtocolVersion(List.of("defaultEndpointProtocolVersion")) .subprotocol("defaultSubprotocol") .subprotocolBody("defaultSubprotocolBody") .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding"); diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json index 1b8414a72..2f9502f5d 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -1,9 +1,9 @@ { "endpoints" : [ { "protocolInformation" : { - "endpointAddress" : "defaultEndpointAddress", + "href" : "defaultEndpointAddress", "endpointProtocol" : "defaultEndpointProtocol", - "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" @@ -11,8 +11,8 @@ "interface" : "defaultInterface" } ], "administration" : { - "revision" : "defaultAdministrativeInformationRevisionValue", - "version" : "defaultAdministrativeInformationVersionValue", + "revision" : "1", + "version" : "1", "embeddedDataSpecifications" : [ { "dataSpecification" : { "keys" : [ { @@ -23,7 +23,10 @@ }, "dataSpecificationContent" : { "modelType" : "DataSpecificationIec61360", - "preferredName" : [ ] + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] } } ] }, @@ -37,14 +40,8 @@ } ], "idShort" : "defaultIdShort", "id" : "identification", - "globalAssetId" : { - "keys" : [ { - "type" : "AssetAdministrationShell", - "value" : "defaultGlobalAssetId" - } ], - "type" : "ModelReference" - }, - "specificAssetIds" : { + "globalAssetId" : "defaultGlobalAssetId", + "specificAssetIds" : [{ "semanticId" : { "keys" : [ { "type" : "GlobalReference", @@ -61,13 +58,13 @@ }, "name" : "defaultSpecificAssetIdName", "value" : "http://example.company/myAsset" - }, + }], "submodelDescriptors" : [ { "endpoints" : [ { "protocolInformation" : { - "endpointAddress" : "defaultEndpointAddress", + "href" : "defaultEndpointAddress", "endpointProtocol" : "defaultEndpointProtocol", - "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" @@ -75,8 +72,8 @@ "interface" : "defaultInterface" } ], "administration" : { - "revision" : "defaultAdministrativeInformationRevisionValue", - "version" : "defaultAdministrativeInformationVersionValue", + "revision" : "1", + "version" : "1", "embeddedDataSpecifications" : [ { "dataSpecification" : { "keys" : [ { @@ -87,7 +84,10 @@ }, "dataSpecificationContent" : { "modelType" : "DataSpecificationIec61360", - "preferredName" : [ ] + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] } } ] }, diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json index 9c0bcb1ee..8b272ea37 100644 --- a/dataformat-json/src/test/resources/submodelDescriptor.json +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -1,9 +1,9 @@ { "endpoints" : [ { "protocolInformation" : { - "endpointAddress" : "defaultEndpointAddress", + "href" : "defaultEndpointAddress", "endpointProtocol" : "defaultEndpointProtocol", - "endpointProtocolVersion" : "defaultEndpointProtocolVersion", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" @@ -11,8 +11,8 @@ "interface" : "defaultInterface" } ], "administration" : { - "revision" : "defaultAdministrativeInformationRevisionValue", - "version" : "defaultAdministrativeInformationVersionValue", + "revision" : "1", + "version" : "1", "embeddedDataSpecifications" : [ { "dataSpecification" : { "keys" : [ { @@ -23,7 +23,10 @@ }, "dataSpecificationContent" : { "modelType" : "DataSpecificationIec61360", - "preferredName" : [ ] + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] } } ] }, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java index ca6a03bb2..c9c019409 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -86,7 +86,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the String for the property idShort. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") - Reference getGlobalAssetId(); + String getGlobalAssetId(); /** * @@ -94,7 +94,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param globalAssetId desired value for the property globalAssetId. */ - void setGlobalAssetId(Reference globalAssetId); + void setGlobalAssetId(String globalAssetId); /** * @@ -138,7 +138,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * @return Returns the String for the property specificAssetId. */ @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") - SpecificAssetId getSpecificAssetIds(); + List getSpecificAssetIds(); /** * @@ -146,7 +146,7 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { * * @param specificAssetIds desired value for the property specificAssetIds. */ - void setSpecificAssetIds(SpecificAssetId specificAssetIds); + void setSpecificAssetIds(List specificAssetIds); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java index 8b4527f69..e7799163c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -19,6 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; +import java.util.List; + /** */ @KnownSubtypes({ @@ -32,16 +34,16 @@ public interface ProtocolInformation { * * @return Returns the String for the property endpointAddress. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") - String getEndpointAddress(); + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href") + String getHref(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href * - * @param endpointAddress desired value for the property endpointAddress. + * @param href desired value for the property endpointAddress. */ - void setEndpointAddress(String endpointAddress); + void setHref(String href); /** * @@ -68,7 +70,7 @@ public interface ProtocolInformation { * @return Returns the String for the property endpointProtocolVersion. */ @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") - String getEndpointProtocolVersion(); + List getEndpointProtocolVersion(); /** * @@ -77,7 +79,7 @@ public interface ProtocolInformation { * * @param endpointProtocolVersion desired value for the property endpointProtocolVersion. */ - void setEndpointProtocolVersion(String endpointProtocolVersion); + void setEndpointProtocolVersion(List endpointProtocolVersion); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java index 97e87ccbe..08b885d76 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -80,11 +80,11 @@ public B identification(String id) { /** * This function allows setting a value for specificAssetId * - * @param specificAssetId desired value to be set + * @param specificAssetIds desired value to be set * @return Builder object with new value for specificAssetId */ - public B specificAssetId(SpecificAssetId specificAssetId) { - getBuildingInstance().setSpecificAssetIds(specificAssetId); + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); return getSelf(); } @@ -94,7 +94,7 @@ public B specificAssetId(SpecificAssetId specificAssetId) { * @param globalAssetId desired value to be set * @return Builder object with new value for globalAssetId */ - public B globalAssetId(Reference globalAssetId) { + public B globalAssetId(String globalAssetId) { getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java index e158128d3..e57effbf2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -17,17 +17,19 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import java.util.List; + public abstract class ProtocolInformationBuilder> extends ExtendableBuilder { /** * This function allows setting a value for endpointAddress * - * @param endpointAddress desired value to be set + * @param href desired value to be set * @return Builder object with new value for endpointAddress */ - public B endpointAddress(String endpointAddress) { - getBuildingInstance().setEndpointAddress(endpointAddress); + public B href(String href) { + getBuildingInstance().setHref(href); return getSelf(); } @@ -48,7 +50,7 @@ public B endpointProtocol(String endpointProtocol) { * @param endpointProtocolVersion desired value to be set * @return Builder object with new value for endpointProtocolVersion */ - public B endpointProtocolVersion(String endpointProtocolVersion) { + public B endpointProtocolVersion(List endpointProtocolVersion) { getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersion); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index 4237dd54b..b349ae1c5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -45,10 +45,10 @@ public class DefaultAssetAdministrationShellDescriptor implements AssetAdministr protected String id; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") - protected Reference globalAssetId; + protected String globalAssetId; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") - protected SpecificAssetId specificAssetId; + protected List specificAssetIds; @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") protected List submodelDescriptor; @@ -65,7 +65,7 @@ public int hashCode() { this.idShort, this.id, this.globalAssetId, - this.specificAssetId, + this.specificAssetIds, this.submodelDescriptor, this.endpoints); } @@ -86,7 +86,7 @@ public boolean equals(Object obj) { Objects.equals(this.idShort, other.idShort) && Objects.equals(this.id, other.id) && Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetId, other.specificAssetId) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.submodelDescriptor, other.submodelDescriptor) && Objects.equals(this.endpoints, other.endpoints); } @@ -143,23 +143,23 @@ public void setId(String id) { } @Override - public Reference getGlobalAssetId() { + public String getGlobalAssetId() { return globalAssetId; } @Override - public void setGlobalAssetId(Reference globalAssetId) { + public void setGlobalAssetId(String globalAssetId) { this.globalAssetId = globalAssetId; } @Override - public SpecificAssetId getSpecificAssetIds() { - return specificAssetId; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setSpecificAssetIds(SpecificAssetId specificAssetId) { - this.specificAssetId = specificAssetId; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java index 4f2d99fb2..9d5dfa3a7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -19,19 +19,20 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; +import java.util.List; import java.util.Objects; @IRI("aas:ProtocolInformation") public class DefaultProtocolInformation implements ProtocolInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress") - protected String endpointAddress; + @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href") + protected String href; @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") protected String endpointProtocol; @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") - protected String endpointProtocolVersion; + protected List endpointProtocolVersion; @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") protected String subprotocol; @@ -47,7 +48,7 @@ public DefaultProtocolInformation() { @Override public int hashCode() { - return Objects.hash(this.endpointAddress, + return Objects.hash(this.href, this.endpointProtocol, this.endpointProtocolVersion, this.subprotocol, @@ -65,7 +66,7 @@ public boolean equals(Object obj) { return false; } else { DefaultProtocolInformation other = (DefaultProtocolInformation) obj; - return Objects.equals(this.endpointAddress, other.endpointAddress) && + return Objects.equals(this.href, other.href) && Objects.equals(this.endpointProtocol, other.endpointProtocol) && Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && Objects.equals(this.subprotocol, other.subprotocol) && @@ -75,13 +76,13 @@ public boolean equals(Object obj) { } @Override - public String getEndpointAddress() { - return endpointAddress; + public String getHref() { + return href; } @Override - public void setEndpointAddress(String endpointAddress) { - this.endpointAddress = endpointAddress; + public void setHref(String href) { + this.href = href; } @Override @@ -95,12 +96,12 @@ public void setEndpointProtocol(String endpointProtocol) { } @Override - public String getEndpointProtocolVersion() { + public List getEndpointProtocolVersion() { return endpointProtocolVersion; } @Override - public void setEndpointProtocolVersion(String endpointProtocolVersion) { + public void setEndpointProtocolVersion(List endpointProtocolVersion) { this.endpointProtocolVersion = endpointProtocolVersion; } From a4cededb511abceaa95cd2820d74a72a556407d6 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 12:25:57 +0200 Subject: [PATCH 33/91] add v3.0.1 classes of new model generator run --- .../json/JsonReferableDeserializerTest.java | 1 + .../json/JsonReferableSerializerTest.java | 1 + .../v3/dataformat/json/util/Examples.java | 46 ++-- .../src/test/resources/Example-Full.json | 18 +- .../src/test/resources/Submodel.json | 6 +- .../test/resources/SubmodelElement-List.json | 6 +- .../src/test/resources/SubmodelElement.json | 6 +- .../aas4j/v3/model/AasSubmodelElements.java | 2 + .../aas4j/v3/model/AbstractLangString.java | 8 +- .../v3/model/AdministrativeInformation.java | 4 +- .../model/AnnotatedRelationshipElement.java | 8 +- .../v3/model/AssetAdministrationShell.java | 10 +- .../aas4j/v3/model/AssetInformation.java | 8 +- .../digitaltwin/aas4j/v3/model/AssetKind.java | 2 + .../aas4j/v3/model/BasicEventElement.java | 4 +- .../digitaltwin/aas4j/v3/model/Blob.java | 4 +- .../aas4j/v3/model/Capability.java | 4 +- .../aas4j/v3/model/ConceptDescription.java | 10 +- .../aas4j/v3/model/DataElement.java | 2 + .../v3/model/DataSpecificationContent.java | 5 +- .../v3/model/DataSpecificationIec61360.java | 8 +- .../model/DataSpecificationPhysicalUnit.java | 99 --------- .../aas4j/v3/model/DataTypeDefXsd.java | 2 + .../aas4j/v3/model/DataTypeIec61360.java | 2 + .../digitaltwin/aas4j/v3/model/Direction.java | 2 + .../v3/model/EmbeddedDataSpecification.java | 4 +- .../digitaltwin/aas4j/v3/model/Entity.java | 8 +- .../aas4j/v3/model/EntityType.java | 2 + .../aas4j/v3/model/Environment.java | 8 +- .../aas4j/v3/model/EventElement.java | 2 + .../aas4j/v3/model/EventPayload.java | 4 +- .../digitaltwin/aas4j/v3/model/Extension.java | 8 +- .../digitaltwin/aas4j/v3/model/File.java | 4 +- .../aas4j/v3/model/HasDataSpecification.java | 10 +- .../aas4j/v3/model/HasExtensions.java | 7 +- .../digitaltwin/aas4j/v3/model/HasKind.java | 2 + .../aas4j/v3/model/HasSemantics.java | 11 +- .../aas4j/v3/model/Identifiable.java | 4 + .../digitaltwin/aas4j/v3/model/Key.java | 4 +- .../digitaltwin/aas4j/v3/model/KeyTypes.java | 2 + .../LangStringDefinitionTypeIec61360.java | 4 +- .../aas4j/v3/model/LangStringNameType.java | 4 +- .../LangStringPreferredNameTypeIec61360.java | 4 +- .../LangStringShortNameTypeIec61360.java | 4 +- .../aas4j/v3/model/LangStringTextType.java | 4 +- .../digitaltwin/aas4j/v3/model/LevelType.java | 4 +- .../digitaltwin/aas4j/v3/model/ModelType.java | 125 +++++++++++ .../aas4j/v3/model/ModellingKind.java | 2 + .../aas4j/v3/model/MultiLanguageProperty.java | 8 +- .../digitaltwin/aas4j/v3/model/Operation.java | 8 +- .../aas4j/v3/model/OperationVariable.java | 4 +- .../digitaltwin/aas4j/v3/model/Property.java | 4 +- .../aas4j/v3/model/ProtocolInformation.java | 61 +++--- .../aas4j/v3/model/Qualifiable.java | 9 +- .../digitaltwin/aas4j/v3/model/Qualifier.java | 4 +- .../aas4j/v3/model/QualifierKind.java | 2 + .../digitaltwin/aas4j/v3/model/Range.java | 4 +- .../digitaltwin/aas4j/v3/model/Referable.java | 12 +- .../digitaltwin/aas4j/v3/model/Reference.java | 8 +- .../aas4j/v3/model/ReferenceElement.java | 4 +- .../aas4j/v3/model/ReferenceTypes.java | 2 + .../aas4j/v3/model/RelationshipElement.java | 4 +- .../digitaltwin/aas4j/v3/model/Resource.java | 4 +- .../aas4j/v3/model/SpecificAssetId.java | 4 +- .../aas4j/v3/model/StateOfEvent.java | 2 + .../digitaltwin/aas4j/v3/model/Submodel.java | 10 +- .../aas4j/v3/model/SubmodelDescriptor.java | 87 ++++---- .../aas4j/v3/model/SubmodelElement.java | 4 +- .../v3/model/SubmodelElementCollection.java | 8 +- .../aas4j/v3/model/SubmodelElementList.java | 8 +- .../digitaltwin/aas4j/v3/model/ValueList.java | 8 +- .../aas4j/v3/model/ValueReferencePair.java | 4 +- .../v3/model/annotations/KnownSubtypes.java | 2 +- .../AdministrativeInformationBuilder.java | 8 +- .../AnnotatedRelationshipElementBuilder.java | 116 +++++----- .../AssetAdministrationShellBuilder.java | 50 ++--- ...tAdministrationShellDescriptorBuilder.java | 171 +++++++++++---- .../builder/AssetInformationBuilder.java | 9 +- .../builder/BasicEventElementBuilder.java | 116 +++++----- .../aas4j/v3/model/builder/BlobBuilder.java | 116 +++++----- .../v3/model/builder/CapabilityBuilder.java | 116 +++++----- .../builder/ConceptDescriptionBuilder.java | 50 ++--- .../DataSpecificationIec61360Builder.java | 6 +- .../v3/model/builder/DescriptorBuilder.java | 74 +++++-- .../EmbeddedDataSpecificationBuilder.java | 6 +- .../v3/model/builder/EndpointBuilder.java | 19 +- .../aas4j/v3/model/builder/EntityBuilder.java | 116 +++++----- .../v3/model/builder/EnvironmentBuilder.java | 9 +- .../v3/model/builder/EventPayloadBuilder.java | 5 +- .../v3/model/builder/ExtensionBuilder.java | 8 +- .../aas4j/v3/model/builder/FileBuilder.java | 116 +++++----- .../aas4j/v3/model/builder/KeyBuilder.java | 5 +- ...ngStringDefinitionTypeIec61360Builder.java | 4 +- .../builder/LangStringNameTypeBuilder.java | 4 +- ...tringPreferredNameTypeIec61360Builder.java | 4 +- ...angStringShortNameTypeIec61360Builder.java | 4 +- .../builder/LangStringTextTypeBuilder.java | 4 +- .../v3/model/builder/LevelTypeBuilder.java | 4 +- .../builder/MultiLanguagePropertyBuilder.java | 116 +++++----- .../v3/model/builder/OperationBuilder.java | 116 +++++----- .../builder/OperationVariableBuilder.java | 5 +- .../v3/model/builder/PropertyBuilder.java | 116 +++++----- .../builder/ProtocolInformationBuilder.java | 32 ++- .../v3/model/builder/QualifierBuilder.java | 9 +- .../aas4j/v3/model/builder/RangeBuilder.java | 116 +++++----- .../v3/model/builder/ReferenceBuilder.java | 8 +- .../builder/ReferenceElementBuilder.java | 116 +++++----- .../builder/RelationshipElementBuilder.java | 116 +++++----- .../v3/model/builder/ResourceBuilder.java | 4 +- .../model/builder/SpecificAssetIdBuilder.java | 7 +- .../v3/model/builder/SubmodelBuilder.java | 138 ++++++------ .../builder/SubmodelDescriptorBuilder.java | 124 ++++++++--- .../SubmodelElementCollectionBuilder.java | 116 +++++----- .../builder/SubmodelElementListBuilder.java | 116 +++++----- .../v3/model/builder/ValueListBuilder.java | 7 +- .../builder/ValueReferencePairBuilder.java | 5 +- .../DefaultAdministrativeInformation.java | 19 +- .../DefaultAnnotatedRelationshipElement.java | 100 +++++---- .../impl/DefaultAssetAdministrationShell.java | 51 +++-- ...ultAssetAdministrationShellDescriptor.java | 202 ++++++++++++------ .../model/impl/DefaultAssetInformation.java | 20 +- .../model/impl/DefaultBasicEventElement.java | 105 +++++---- .../aas4j/v3/model/impl/DefaultBlob.java | 99 +++++---- .../v3/model/impl/DefaultCapability.java | 97 +++++---- .../model/impl/DefaultConceptDescription.java | 49 +++-- .../DefaultDataSpecificationIec61360.java | 24 ++- .../v3/model/impl/DefaultDescriptor.java | 86 ++++++-- .../DefaultEmbeddedDataSpecification.java | 16 +- .../aas4j/v3/model/impl/DefaultEndpoint.java | 54 +++-- .../aas4j/v3/model/impl/DefaultEntity.java | 101 +++++---- .../v3/model/impl/DefaultEnvironment.java | 18 +- .../v3/model/impl/DefaultEventPayload.java | 21 +- .../aas4j/v3/model/impl/DefaultExtension.java | 24 ++- .../aas4j/v3/model/impl/DefaultFile.java | 99 +++++---- .../aas4j/v3/model/impl/DefaultKey.java | 15 +- ...faultLangStringDefinitionTypeIec61360.java | 14 +- .../model/impl/DefaultLangStringNameType.java | 14 +- ...ltLangStringPreferredNameTypeIec61360.java | 14 +- ...efaultLangStringShortNameTypeIec61360.java | 14 +- .../model/impl/DefaultLangStringTextType.java | 14 +- .../aas4j/v3/model/impl/DefaultLevelType.java | 16 +- .../impl/DefaultMultiLanguageProperty.java | 99 +++++---- .../aas4j/v3/model/impl/DefaultOperation.java | 100 +++++---- .../model/impl/DefaultOperationVariable.java | 14 +- .../aas4j/v3/model/impl/DefaultProperty.java | 100 +++++---- .../impl/DefaultProtocolInformation.java | 69 ++++-- .../aas4j/v3/model/impl/DefaultQualifier.java | 26 ++- .../aas4j/v3/model/impl/DefaultRange.java | 100 +++++---- .../aas4j/v3/model/impl/DefaultReference.java | 17 +- .../model/impl/DefaultReferenceElement.java | 98 +++++---- .../impl/DefaultRelationshipElement.java | 99 +++++---- .../aas4j/v3/model/impl/DefaultResource.java | 14 +- .../v3/model/impl/DefaultSpecificAssetId.java | 18 +- .../aas4j/v3/model/impl/DefaultSubmodel.java | 129 ++++++----- .../model/impl/DefaultSubmodelDescriptor.java | 155 +++++++++----- .../DefaultSubmodelElementCollection.java | 98 +++++---- .../impl/DefaultSubmodelElementList.java | 106 +++++---- .../aas4j/v3/model/impl/DefaultValueList.java | 14 +- .../model/impl/DefaultValueReferencePair.java | 15 +- 159 files changed, 3404 insertions(+), 2334 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelType.java diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 8521e220f..0938c90e2 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -104,6 +104,7 @@ public void testReadEmptyReferableList() throws DeserializationException { } @Test + @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; Object expected = exampleData.getModel(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 8c75a343d..c8301e0d5 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -49,6 +49,7 @@ public void testSerializeAASs() throws IOException, SerializationException, JSON } @Test + @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index e2d6deb90..202e59bb4 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -85,29 +85,29 @@ public class Examples { .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02") .build()) .build()) - .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() - .conversionFactor("1.0") - .eceCode("ece-code") - .eceName("ece-name") - .definition(new DefaultLangStringTextType.Builder() - .language("en") - .text("definition-en") - .build()) - .definition(new DefaultLangStringTextType.Builder() - .language("de") - .text("definition-de") - .build()) - .nistName("nist-name") - .dinNotation("din-notation") - .siName("si-name") - .registrationAuthorityId("registration-authority-id") - .siNotation("si-notation") - .sourceOfDefinition("source-of-definition") - .supplier("supplier") - .unitName("unit-name") - .unitSymbol("unit-symbol") - .build()) - .build()) +// .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() +// .conversionFactor("1.0") +// .eceCode("ece-code") +// .eceName("ece-name") +// .definition(new DefaultLangStringTextType.Builder() +// .language("en") +// .text("definition-en") +// .build()) +// .definition(new DefaultLangStringTextType.Builder() +// .language("de") +// .text("definition-de") +// .build()) +// .nistName("nist-name") +// .dinNotation("din-notation") +// .siName("si-name") +// .registrationAuthorityId("registration-authority-id") +// .siNotation("si-notation") +// .sourceOfDefinition("source-of-definition") +// .supplier("supplier") +// .unitName("unit-name") +// .unitSymbol("unit-symbol") +// .build()) + .build()) .build(), "ConceptDescription-DataSpecificationPhysicalUnit.json"); diff --git a/dataformat-json/src/test/resources/Example-Full.json b/dataformat-json/src/test/resources/Example-Full.json index 1e3cf3770..75c0cd989 100644 --- a/dataformat-json/src/test/resources/Example-Full.json +++ b/dataformat-json/src/test/resources/Example-Full.json @@ -352,12 +352,14 @@ { "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" }, { "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" } ], "idShort": "ManufacturerName", @@ -1553,7 +1555,8 @@ "qualifiers": [ { "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" + "valueType": "xs:string", + "kind": "ConceptQualifier" } ], "category": "CONSTANT", @@ -1589,7 +1592,8 @@ "qualifiers": [ { "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" + "valueType": "xs:string", + "kind": "ConceptQualifier" } ], "category": "CONSTANT", @@ -1625,7 +1629,8 @@ "qualifiers": [ { "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" + "valueType": "xs:string", + "kind": "ConceptQualifier" } ], "category": "CONSTANT", @@ -1763,7 +1768,8 @@ "qualifiers": [ { "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" + "valueType": "xs:string", + "kind": "ConceptQualifier" } ], "category": "CONSTANT", diff --git a/dataformat-json/src/test/resources/Submodel.json b/dataformat-json/src/test/resources/Submodel.json index c3751c085..c49924bd0 100644 --- a/dataformat-json/src/test/resources/Submodel.json +++ b/dataformat-json/src/test/resources/Submodel.json @@ -48,12 +48,14 @@ { "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" }, { "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" } ], "idShort": "ManufacturerName", diff --git a/dataformat-json/src/test/resources/SubmodelElement-List.json b/dataformat-json/src/test/resources/SubmodelElement-List.json index 1227c8245..9c1f12dcb 100644 --- a/dataformat-json/src/test/resources/SubmodelElement-List.json +++ b/dataformat-json/src/test/resources/SubmodelElement-List.json @@ -33,12 +33,14 @@ { "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" }, { "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" } ], "idShort": "ManufacturerName", diff --git a/dataformat-json/src/test/resources/SubmodelElement.json b/dataformat-json/src/test/resources/SubmodelElement.json index fb11778ca..18cb4c247 100644 --- a/dataformat-json/src/test/resources/SubmodelElement.json +++ b/dataformat-json/src/test/resources/SubmodelElement.json @@ -27,12 +27,14 @@ { "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" }, { "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", - "valueType": "xs:int" + "valueType": "xs:int", + "kind": "ConceptQualifier" } ], "idShort": "ManufacturerName", diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java index 311f54a79..d11c62e38 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AasSubmodelElements.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index 7689f9526..d20808f99 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -19,17 +19,19 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** * Strings with language tags */ @KnownSubtypes({ + @KnownSubtypes.Type(value = LangStringTextType.class), + @KnownSubtypes.Type(value = LangStringNameType.class), @KnownSubtypes.Type(value = LangStringPreferredNameTypeIec61360.class), @KnownSubtypes.Type(value = LangStringShortNameTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringNameType.class), - @KnownSubtypes.Type(value = LangStringTextType.class) + @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class) }) public interface AbstractLangString { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java index 25e8457fd..feea7db28 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AdministrativeInformation.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java index 987cc7a15..ad4175959 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElement.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElement; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 2b51a7a67..bce30a8f3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -28,7 +30,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultAssetAdministrationShell.class) }) -public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { +public interface AssetAdministrationShell extends Identifiable, HasDataSpecification { /** * The reference to the AAS the AAS was derived from. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java index 61ce8f421..62446eb0a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetInformation.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java index 80401d406..9167faa1d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetKind.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java index b4544ceef..a3711ed09 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElement.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java index 1edb58bed..0b5f00142 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Blob.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlob; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java index 0dc242c2f..d7bde51c4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Capability.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapability; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index 724d31fed..2e50360a6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -29,7 +31,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultConceptDescription.class) }) -public interface ConceptDescription extends HasDataSpecification, Identifiable { +public interface ConceptDescription extends Identifiable, HasDataSpecification { /** * Reference to an external definition the concept is compatible to or was derived from. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index 628d658af..8778ba3d7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 815698216..f4e56cc03 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -26,8 +28,7 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class), - @KnownSubtypes.Type(value = DataSpecificationPhysicalUnit.class) + @KnownSubtypes.Type(value = DataSpecificationIec61360.class) }) public interface DataSpecificationContent { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java index 182a70102..01a398b69 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationIec61360.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java deleted file mode 100644 index 9293aee49..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationPhysicalUnit; - - -/** - * Content of data specification template for concept descriptions for properties, values and value - * lists conformant to IEC 61360. - */ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultDataSpecificationPhysicalUnit.class) -}) -public interface DataSpecificationPhysicalUnit extends DataSpecificationContent { - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/conversionFactor") - String getConversionFactor(); - - void setConversionFactor(String conversionFactor); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/dinNotation") - String getDinNotation(); - - void setDinNotation(String dinNotation); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceCode") - String getEceCode(); - - void setEceCode(String eceCode); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceName") - String getEceName(); - - void setEceName(String eceName); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/nistName") - String getNistName(); - - void setNistName(String nistName); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/registrationAuthorityId") - String getRegistrationAuthorityId(); - - void setRegistrationAuthorityId(String registrationAuthorityId); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siName") - String getSiName(); - - void setSiName(String siName); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siNotation") - String getSiNotation(); - - void setSiNotation(String siNotation); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/sourceOfDefinition") - String getSourceOfDefinition(); - - void setSourceOfDefinition(String sourceOfDefinition); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/supplier") - String getSupplier(); - - void setSupplier(String supplier); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitName") - String getUnitName(); - - void setUnitName(String unitName); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitSymbol") - String getUnitSymbol(); - - void setUnitSymbol(String unitSymbol); - - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/definition") - List getDefinition(); - - void setDefinition(List definition); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java index cb41effbd..086da3f52 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeDefXsd.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java index d0ddfa144..841aa9552 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataTypeIec61360.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java index dcc154a6c..7d5a87c34 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Direction.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java index 48c3a2ccb..7b4116345 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EmbeddedDataSpecification.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java index c29c453e2..bd30d4bf3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Entity.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntity; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java index 233102815..5455d6325 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityType.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java index e41524972..e6c9602a4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Environment.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java index a134a0289..de036b8b1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventElement.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java index 42720b37c..831625266 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EventPayload.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEventPayload; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java index c3c5f2659..60eac5536 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Extension.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java index ed40d2d1e..3f63ede40 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/File.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index 5887c38e5..f47141a40 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -15,10 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -26,6 +29,9 @@ */ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), + @KnownSubtypes.Type(value = AssetAdministrationShellMetadata.class), + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = SubmodelElement.class), diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java index 761b5baca..708fdaf96 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasExtensions.java @@ -15,10 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java index 452c60ee1..a2cbddf95 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasKind.java @@ -19,6 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 41f9b9978..54b694019 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -15,10 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -26,9 +29,11 @@ */ @KnownSubtypes({ @KnownSubtypes.Type(value = SpecificAssetId.class), + @KnownSubtypes.Type(value = Extension.class), + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), - @KnownSubtypes.Type(value = Extension.class), @KnownSubtypes.Type(value = Qualifier.class) }) public interface HasSemantics { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index 6cf22f3bf..b11e8c126 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -19,12 +19,16 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** * An element that has a globally unique identifier. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = AssetAdministrationShellMetadata.class), + @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = Submodel.class) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java index f91b08a96..cbc52210a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Key.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java index 84d18f137..a4ec782f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/KeyTypes.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java index fb49700bd..265aa039e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringDefinitionTypeIec61360.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java index 1fe4604ef..464e95aef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringNameType.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java index e03afda72..40168c841 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringPreferredNameTypeIec61360.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java index 98fcdaf14..141eae315 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringShortNameTypeIec61360.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java index 2ff44c065..78a0df8e9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangStringTextType.java @@ -16,8 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java index 4f3931d96..7a9b37528 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LevelType.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLevelType; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelType.java new file mode 100644 index 000000000..3997cf660 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelType.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@IRI("aas:ModelType") +public enum ModelType { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/AnnotatedRelationshipElement") + ANNOTATED_RELATIONSHIP_ELEMENT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/AssetAdministrationShell") + ASSET_ADMINISTRATION_SHELL, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/BasicEventElement") + BASIC_EVENT_ELEMENT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Blob") + BLOB, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Capability") + CAPABILITY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/ConceptDescription") + CONCEPT_DESCRIPTION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Entity") + ENTITY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/File") + FILE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/MultiLanguageProperty") + MULTI_LANGUAGE_PROPERTY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Operation") + OPERATION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Property") + PROPERTY, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Qualifier") + QUALIFIER, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Range") + RANGE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Reference") + REFERENCE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/ReferenceElement") + REFERENCE_ELEMENT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/RelationshipElement") + RELATIONSHIP_ELEMENT, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/Submodel") + SUBMODEL, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/SubmodelElementCollection") + SUBMODEL_ELEMENT_COLLECTION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ModelType/SubmodelElementList") + SUBMODEL_ELEMENT_LIST; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java index aba02a581..fb51c79d6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ModellingKind.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java index 5058811c4..95e1ea322 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguageProperty.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguageProperty; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java index 093835165..3e5c44d7d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Operation.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java index c61563481..3b3a93ba6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationVariable.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java index 72fc83156..4b9859893 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Property.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java index e7799163c..f130166a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,11 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import java.util.List; /** */ @@ -30,33 +33,33 @@ public interface ProtocolInformation { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointAddress + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href * - * @return Returns the String for the property endpointAddress. + * @return Returns the String for the property href. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") String getHref(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href * - * @param href desired value for the property endpointAddress. + * @param href desired value for the property href. */ void setHref(String href); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol * * @return Returns the String for the property endpointProtocol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") String getEndpointProtocol(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol * * @param endpointProtocol desired value for the property endpointProtocol. */ @@ -64,35 +67,33 @@ public interface ProtocolInformation { /** * - * More information under - * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion * - * @return Returns the String for the property endpointProtocolVersion. + * @return Returns the List of Strings for the property endpointProtocolVersion. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") List getEndpointProtocolVersion(); /** * - * More information under - * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion * - * @param endpointProtocolVersion desired value for the property endpointProtocolVersion. + * @param endpointProtocolVersions desired value for the property endpointProtocolVersion. */ - void setEndpointProtocolVersion(List endpointProtocolVersion); + void setEndpointProtocolVersion(List endpointProtocolVersions); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol * * @return Returns the String for the property subprotocol. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") String getSubprotocol(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol * * @param subprotocol desired value for the property subprotocol. */ @@ -100,16 +101,16 @@ public interface ProtocolInformation { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody * * @return Returns the String for the property subprotocolBody. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") String getSubprotocolBody(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody * * @param subprotocolBody desired value for the property subprotocolBody. */ @@ -117,18 +118,16 @@ public interface ProtocolInformation { /** * - * More information under - * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding * * @return Returns the String for the property subprotocolBodyEncoding. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") String getSubprotocolBodyEncoding(); /** * - * More information under - * https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding * * @param subprotocolBodyEncoding desired value for the property subprotocolBodyEncoding. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index d8f0e2e84..d62f20704 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -15,16 +15,21 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** * The value of a qualifiable element may be further qualified by one or more qualifiers. */ @KnownSubtypes({ + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java index fd3876c9d..084218df8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifier.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultQualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java index 3f34d3abd..0cf38b450 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/QualifierKind.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java index 9c9c60f51..182b9d34a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Range.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRange; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 71c5e6ad8..6800bdb6e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -15,18 +15,22 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), - @KnownSubtypes.Type(value = Identifiable.class) + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = Identifiable.class), + @KnownSubtypes.Type(value = SubmodelElement.class) }) public interface Referable extends HasExtensions { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java index ee6ceffda..0fa5eb431 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Reference.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java index 40a6de3a5..bb2bae46b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElement.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java index 99ded8f49..0298bfd5f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceTypes.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java index 986c78aa2..124e7d1f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElement.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java index 4534c1408..51090767f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Resource.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java index c868e3e2b..40e6aac22 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SpecificAssetId.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java index c71416c94..e5c4a31e3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StateOfEvent.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 4e8fd3266..576af0d66 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -28,7 +30,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { +public interface Submodel extends Identifiable, HasDataSpecification, HasSemantics, Qualifiable, HasKind { /** * A submodel consists of zero or more submodel elements. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java index 14e283792..f0f858480 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,11 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import java.util.List; /** */ @@ -30,16 +33,16 @@ public interface SubmodelDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration") AdministrativeInformation getAdministration(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration * * @param administration desired value for the property administration. */ @@ -47,50 +50,33 @@ public interface SubmodelDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints * - * @return Returns the LangStringSet for the property description. + * @return Returns the List of Endpoints for the property endpoints. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - List getDescription(); + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints") + List getEndpoints(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints * - * @param description desired value for the property description. + * @param endpoints desired value for the property endpoints. */ - void setDescription(List description); + void setEndpoints(List endpoints); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName - * - * @return Returns the LangStringSet for the property displayName. - */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - List getDisplayName(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName - * - * @param displayName desired value for the property displayName. - */ - void setDisplayName(List displayName); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort * * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort") String getIdShort(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort * * @param idShort desired value for the property idShort. */ @@ -98,36 +84,53 @@ public interface SubmodelDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/id * - * @return Returns the String for the property identification. + * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/id") String getId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/id * - * @param id desired value for the property identification. + * @param id desired value for the property id. */ void setId(String id); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId * * @return Returns the Reference for the property semanticId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId") Reference getSemanticId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId * * @param semanticId desired value for the property semanticId. */ void setSemanticId(Reference semanticId); + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId + * + * @return Returns the List of References for the property supplementalSemanticId. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId") + List getSupplementalSemanticId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId + * + * @param supplementalSemanticIds desired value for the property supplementalSemanticId. + */ + void setSupplementalSemanticId(List supplementalSemanticIds); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index 5c19158d9..d2d9f3b29 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -18,6 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** @@ -33,6 +35,6 @@ @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { +public interface SubmodelElement extends HasDataSpecification, Referable, HasSemantics, Qualifiable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java index 2080567bd..d963cbb44 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollection.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java index 7e94212b4..dabdc7c61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementList.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java index 9313bc322..e5b9a797a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueList.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueList; - -import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java index 53d12d3bf..3bee19c69 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ValueReferencePair.java @@ -16,9 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultValueReferencePair; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java index 1c13de81d..535f8e991 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/annotations/KnownSubtypes.java @@ -28,7 +28,7 @@ * * @return List of known implementing subtypes */ - public Type[] value(); + public KnownSubtypes.Type[] value(); public @interface Type { Class value(); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java index f75faf333..a49262f2d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AdministrativeInformationBuilder.java @@ -15,13 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class AdministrativeInformationBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index f26548cc2..2f55d377a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class AnnotatedRelationshipElementBuilder> extends ExtendableBuilder { @@ -89,61 +91,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -231,4 +178,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index 51e9059c1..166b2625f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class AssetAdministrationShellBuilder> extends ExtendableBuilder { @@ -67,28 +69,6 @@ public B submodels(Reference submodels) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -198,4 +178,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java index 08b885d76..6b58294b8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,9 +15,12 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import java.util.List; public abstract class AssetAdministrationShellDescriptorBuilder> extends ExtendableBuilder { @@ -34,24 +37,57 @@ public B administration(AdministrativeInformation administration) { } /** - * This function allows setting a value for description + * This function allows setting a value for assetKind * - * @param description desired value to be set - * @return Builder object with new value for description + * @param assetKind desired value to be set + * @return Builder object with new value for assetKind */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B assetKind(AssetKind assetKind) { + getBuildingInstance().setAssetKind(assetKind); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows setting a value for assetType * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param assetType desired value to be set + * @return Builder object with new value for assetType + */ + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } + + /** + * This function allows setting a value for globalAssetId + * + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); return getSelf(); } @@ -67,21 +103,21 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for identification + * This function allows setting a value for id * * @param id desired value to be set - * @return Builder object with new value for identification + * @return Builder object with new value for id */ - public B identification(String id) { + public B id(String id) { getBuildingInstance().setId(id); return getSelf(); } /** - * This function allows setting a value for specificAssetId + * This function allows setting a value for specificAssetIds * * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetId + * @return Builder object with new value for specificAssetIds */ public B specificAssetIds(List specificAssetIds) { getBuildingInstance().setSpecificAssetIds(specificAssetIds); @@ -89,46 +125,101 @@ public B specificAssetIds(List specificAssetIds) { } /** - * This function allows setting a value for globalAssetId - * - * @param globalAssetId desired value to be set - * @return Builder object with new value for globalAssetId + * This function allows adding a value to the List specificAssetIds + * + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds */ - public B globalAssetId(String globalAssetId) { - getBuildingInstance().setGlobalAssetId(globalAssetId); + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); return getSelf(); } /** - * This function allows setting a value for submodelDescriptor - * - * @param submodelDescriptor desired value to be set - * @return Builder object with new value for submodelDescriptor + * This function allows setting a value for submodelDescriptors + * + * @param submodelDescriptors desired value to be set + * @return Builder object with new value for submodelDescriptors */ - public B submodelDescriptor(List submodelDescriptor) { - getBuildingInstance().setSubmodelDescriptor(submodelDescriptor); + public B submodelDescriptors(List submodelDescriptors) { + getBuildingInstance().setSubmodelDescriptors(submodelDescriptors); return getSelf(); } /** - * This function allows setting a value for endpoints + * This function allows adding a value to the List submodelDescriptors * - * @param endpoints desired value to be set - * @return Builder object with new value for endpoints + * @param submodelDescriptors desired value to be added + * @return Builder object with new value for submodelDescriptors */ - public B endpoints(List endpoints) { - getBuildingInstance().setEndpoints(endpoints); + public B submodelDescriptors(SubmodelDescriptor submodelDescriptors) { + getBuildingInstance().getSubmodelDescriptors().add(submodelDescriptors); return getSelf(); } /** - * This function allows adding a value to the List endpoints + * This function allows setting a value for description * - * @param endpoints desired value to be added - * @return Builder object with new value for endpoints + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B endpoints(Endpoint endpoints) { - getBuildingInstance().getEndpoints().add(endpoints); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java index 974bbcae2..53662764f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetInformationBuilder.java @@ -15,14 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class AssetInformationBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 718767d8b..45e9546cf 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class BasicEventElementBuilder> extends ExtendableBuilder { @@ -133,61 +135,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -275,4 +222,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index 6fe946097..346a56288 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class BlobBuilder> extends ExtendableBuilder { /** @@ -66,61 +68,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -208,4 +155,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 2264c9c68..bbd759434 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class CapabilityBuilder> extends ExtendableBuilder { /** @@ -44,61 +46,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -186,4 +133,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 85c3f259b..574301a42 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ConceptDescriptionBuilder> extends ExtendableBuilder { @@ -45,28 +47,6 @@ public B isCaseOf(Reference isCaseOf) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -176,4 +156,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java index 41ce802e4..5c562038f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationIec61360Builder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class DataSpecificationIec61360Builder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java index 85175e975..02596330a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,30 +17,76 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + public abstract class DescriptorBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for endpoints + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions * - * @param endpoints desired value to be set - * @return Builder object with new value for endpoints + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B endpoints(List endpoints) { - getBuildingInstance().setEndpoints(endpoints); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows adding a value to the List endpoints + * This function allows adding a value to the List extensions * - * @param endpoints desired value to be added - * @return Builder object with new value for endpoints + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B endpoints(Endpoint endpoints) { - getBuildingInstance().getEndpoints().add(endpoints); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java index f92f45fe4..f62900b87 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EmbeddedDataSpecificationBuilder.java @@ -16,9 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class EmbeddedDataSpecificationBuilder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java index 22c99fe99..7ce0d31ca 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,19 +17,20 @@ -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + public abstract class EndpointBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for interface + * This function allows setting a value for _interface * - * @param interfaceValue desired value to be set - * @return Builder object with new value for interface + * @param _interface desired value to be set + * @return Builder object with new value for _interface */ - public B withInterface(String interfaceValue) { - getBuildingInstance().setInterface(interfaceValue); + public B _interface(String _interface) { + getBuildingInstance().set_interface(_interface); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index fda9f062c..3fe84907d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class EntityBuilder> extends ExtendableBuilder { /** @@ -110,61 +112,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -252,4 +199,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java index 60288ffc2..30e5d8358 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EnvironmentBuilder.java @@ -15,14 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class EnvironmentBuilder> extends ExtendableBuilder { /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java index b3e691032..ab2396475 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EventPayloadBuilder.java @@ -16,8 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.EventPayload; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class EventPayloadBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java index d6dc6f4b4..5d31378f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ExtensionBuilder.java @@ -15,13 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ExtensionBuilder> extends ExtendableBuilder { /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index 4bca2a16f..2bcafa605 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class FileBuilder> extends ExtendableBuilder { /** @@ -66,61 +68,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -208,4 +155,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java index 131e0ee5d..499f60c7a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/KeyBuilder.java @@ -16,8 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class KeyBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java index b6d43e28e..b69f9705d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringDefinitionTypeIec61360Builder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LangStringDefinitionTypeIec61360Builder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java index 2df57ae9c..c08831b1e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringNameTypeBuilder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LangStringNameTypeBuilder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java index 685de3530..665bc48c9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringPreferredNameTypeIec61360Builder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LangStringPreferredNameTypeIec61360Builder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java index 2b37bb3d5..a7fd17d27 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringShortNameTypeIec61360Builder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LangStringShortNameTypeIec61360Builder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java index 55e927566..3056435e3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LangStringTextTypeBuilder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LangStringTextTypeBuilder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java index 47bc13d6c..7f1efd6f7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/LevelTypeBuilder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class LevelTypeBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 706314092..573f36f2d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class MultiLanguagePropertyBuilder> extends ExtendableBuilder { @@ -78,61 +80,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -220,4 +167,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 8c8b23f59..e3970b269 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class OperationBuilder> extends ExtendableBuilder { /** @@ -110,61 +112,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -252,4 +199,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java index cddb89a47..5f96bb319 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationVariableBuilder.java @@ -16,8 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class OperationVariableBuilder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index 9ceee2daa..bce47d1e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class PropertyBuilder> extends ExtendableBuilder { /** @@ -77,61 +79,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -219,4 +166,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java index e57effbf2..2e8c53110 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,18 +15,21 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; - import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ProtocolInformationBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for endpointAddress + * This function allows setting a value for href * * @param href desired value to be set - * @return Builder object with new value for endpointAddress + * @return Builder object with new value for href */ public B href(String href) { getBuildingInstance().setHref(href); @@ -47,11 +50,22 @@ public B endpointProtocol(String endpointProtocol) { /** * This function allows setting a value for endpointProtocolVersion * - * @param endpointProtocolVersion desired value to be set + * @param endpointProtocolVersions desired value to be set + * @return Builder object with new value for endpointProtocolVersion + */ + public B endpointProtocolVersion(List endpointProtocolVersions) { + getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersions); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpointProtocolVersion + * + * @param endpointProtocolVersion desired value to be added * @return Builder object with new value for endpointProtocolVersion */ - public B endpointProtocolVersion(List endpointProtocolVersion) { - getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersion); + public B endpointProtocolVersion(String endpointProtocolVersion) { + getBuildingInstance().getEndpointProtocolVersion().add(endpointProtocolVersion); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java index 24427c217..6a233dbe9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/QualifierBuilder.java @@ -15,14 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class QualifierBuilder> extends ExtendableBuilder { /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index e9bae46c4..06c9d6e0c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class RangeBuilder> extends ExtendableBuilder { /** @@ -77,61 +79,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -219,4 +166,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java index afec436d6..f17c03fe0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceBuilder.java @@ -15,13 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ReferenceBuilder> extends ExtendableBuilder { /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index a34e8526f..b3db4d653 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ReferenceElementBuilder> extends ExtendableBuilder { @@ -56,61 +58,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -198,4 +145,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 1d6208913..1f7aba79f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class RelationshipElementBuilder> extends ExtendableBuilder { @@ -67,61 +69,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -209,4 +156,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java index 9fd9b7d69..ff11a497e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResourceBuilder.java @@ -16,7 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class ResourceBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java index 508446f79..9f210a566 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SpecificAssetIdBuilder.java @@ -15,12 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class SpecificAssetIdBuilder> extends ExtendableBuilder { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index 9b5b784b5..192bc915e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class SubmodelBuilder> extends ExtendableBuilder { /** @@ -44,72 +46,6 @@ public B submodelElements(SubmodelElement submodelElements) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -220,6 +156,61 @@ public B extensions(Extension extensions) { return getSelf(); } + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + /** * This function allows setting a value for qualifiers * @@ -241,4 +232,15 @@ public B qualifiers(Qualifier qualifiers) { getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java index cbc2330a1..53e4b472a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,12 +17,10 @@ import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + public abstract class SubmodelDescriptorBuilder> extends ExtendableBuilder { @@ -39,24 +37,24 @@ public B administration(AdministrativeInformation administration) { } /** - * This function allows setting a value for description + * This function allows setting a value for endpoints * - * @param description desired value to be set - * @return Builder object with new value for description + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints */ - public B description(List description) { - getBuildingInstance().setDescription(description); + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List endpoints * - * @param displayName desired value to be set - * @return Builder object with new value for displayName + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints */ - public B displayName(List displayName) { - getBuildingInstance().setDisplayName(displayName); + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); return getSelf(); } @@ -72,10 +70,10 @@ public B idShort(String idShort) { } /** - * This function allows setting a value for identification + * This function allows setting a value for id * * @param id desired value to be set - * @return Builder object with new value for identification + * @return Builder object with new value for id */ public B id(String id) { getBuildingInstance().setId(id); @@ -94,24 +92,90 @@ public B semanticId(Reference semanticId) { } /** - * This function allows setting a value for endpoints + * This function allows setting a value for supplementalSemanticId * - * @param endpoints desired value to be set - * @return Builder object with new value for endpoints + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticId */ - public B endpoints(List endpoints) { - getBuildingInstance().setEndpoints(endpoints); + public B supplementalSemanticId(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticId(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List endpoints + * This function allows adding a value to the List supplementalSemanticId * - * @param endpoints desired value to be added - * @return Builder object with new value for endpoints + * @param supplementalSemanticId desired value to be added + * @return Builder object with new value for supplementalSemanticId */ - public B endpoints(Endpoint endpoints) { - getBuildingInstance().getEndpoints().add(endpoints); + public B supplementalSemanticId(Reference supplementalSemanticId) { + getBuildingInstance().getSupplementalSemanticId().add(supplementalSemanticId); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index b13efa3e8..aff87bb17 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class SubmodelElementCollectionBuilder> extends ExtendableBuilder { @@ -67,61 +69,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -209,4 +156,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index f52ed9b36..6c80f5560 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -15,11 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.*; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class SubmodelElementListBuilder> extends ExtendableBuilder { @@ -111,61 +113,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -253,4 +200,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java index 5050fe0a7..4aeba5a50 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueListBuilder.java @@ -15,12 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; - import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + public abstract class ValueListBuilder> extends ExtendableBuilder { /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java index 8dfb746d3..bbc1a5bad 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ValueReferencePairBuilder.java @@ -16,8 +16,9 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; public abstract class ValueReferencePairBuilder> diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index e13dbd853..b90f9e4ef 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -15,17 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AdministrativeInformationBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation @@ -53,6 +52,14 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati public DefaultAdministrativeInformation() {} + public DefaultAdministrativeInformation(AdministrativeInformation x) { + this.creator = x.getCreator(); + this.revision = x.getRevision(); + this.templateId = x.getTemplateId(); + this.version = x.getVersion(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + } + @Override public int hashCode() { return Objects.hash(this.version, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 7e8ed7c90..4b3c37789 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AnnotatedRelationshipElementBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement @@ -73,20 +74,35 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi public DefaultAnnotatedRelationshipElement() {} + public DefaultAnnotatedRelationshipElement(AnnotatedRelationshipElement x) { + this.annotations = x.getAnnotations(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.first = x.getFirst(); + this.second = x.getSecond(); + } + @Override public int hashCode() { return Objects.hash(this.annotations, this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -103,14 +119,14 @@ public boolean equals(Object obj) { Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -154,36 +170,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -234,6 +220,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultAnnotatedRelationshipElement (" + "annotations=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 1cc73cb62..03568b196 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell * @@ -68,19 +69,33 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell public DefaultAssetAdministrationShell() {} + public DefaultAssetAdministrationShell(AssetAdministrationShell x) { + this.assetInformation = x.getAssetInformation(); + this.derivedFrom = x.getDerivedFrom(); + this.submodels = x.getSubmodels(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.administration = x.getAdministration(); + this.id = x.getId(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.derivedFrom, this.assetInformation, this.submodels, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -96,14 +111,14 @@ public boolean equals(Object obj) { return Objects.equals(this.derivedFrom, other.derivedFrom) && Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -137,16 +152,6 @@ public void setSubmodels(List submodels) { this.submodels = submodels; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -217,6 +222,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultAssetAdministrationShell (" + "derivedFrom=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index b349ae1c5..e5b6ad662 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -15,59 +15,92 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellDescriptorBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor + * + */ + @IRI("aas:AssetAdministrationShellDescriptor") public class DefaultAssetAdministrationShellDescriptor implements AssetAdministrationShellDescriptor { - @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") - protected List endpoints = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration") protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - protected List description; + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind") + protected AssetKind assetKind; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - protected List displayName; + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType") + protected String assetType; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") - protected String idShort; + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId") + protected String globalAssetId; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/id") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") - protected String globalAssetId; + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds") + protected List specificAssetIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors") + protected List submodelDescriptors = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") - protected List specificAssetIds; + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") - protected List submodelDescriptor; + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); + public DefaultAssetAdministrationShellDescriptor() {} - public DefaultAssetAdministrationShellDescriptor() { + public DefaultAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor x) { + this.administration = x.getAdministration(); + this.assetKind = x.getAssetKind(); + this.assetType = x.getAssetType(); + this.endpoints = x.getEndpoints(); + this.globalAssetId = x.getGlobalAssetId(); + this.id = x.getId(); + this.idShort = x.getIdShort(); + this.specificAssetIds = x.getSpecificAssetIds(); + this.submodelDescriptors = x.getSubmodelDescriptors(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.extensions = x.getExtensions(); } @Override public int hashCode() { return Objects.hash(this.administration, - this.description, - this.displayName, + this.assetKind, + this.assetType, + this.endpoints, + this.globalAssetId, this.idShort, this.id, - this.globalAssetId, this.specificAssetIds, - this.submodelDescriptor, - this.endpoints); + this.submodelDescriptors, + this.description, + this.displayName, + this.extensions); } @Override @@ -81,14 +114,17 @@ public boolean equals(Object obj) { } else { DefaultAssetAdministrationShellDescriptor other = (DefaultAssetAdministrationShellDescriptor) obj; return Objects.equals(this.administration, other.administration) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.assetType, other.assetType) && + Objects.equals(this.endpoints, other.endpoints) && + Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.id, other.id) && - Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.submodelDescriptor, other.submodelDescriptor) && - Objects.equals(this.endpoints, other.endpoints); + Objects.equals(this.submodelDescriptors, other.submodelDescriptors) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); } } @@ -103,23 +139,43 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { - return description; + public AssetKind getAssetKind() { + return assetKind; } @Override - public void setDescription(List description) { - this.description = description; + public void setAssetKind(AssetKind assetKind) { + this.assetKind = assetKind; } @Override - public List getDisplayName() { - return displayName; + public String getAssetType() { + return assetType; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + @Override + public String getGlobalAssetId() { + return globalAssetId; + } + + @Override + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; } @Override @@ -143,55 +199,69 @@ public void setId(String id) { } @Override - public String getGlobalAssetId() { - return globalAssetId; + public List getSpecificAssetIds() { + return specificAssetIds; } @Override - public void setGlobalAssetId(String globalAssetId) { - this.globalAssetId = globalAssetId; + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; } @Override - public List getSpecificAssetIds() { - return specificAssetIds; + public List getSubmodelDescriptors() { + return submodelDescriptors; } @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; + public void setSubmodelDescriptors(List submodelDescriptors) { + this.submodelDescriptors = submodelDescriptors; } @Override - public List getSubmodelDescriptor() { - return submodelDescriptor; + public List getDescription() { + return description; } @Override - public void setSubmodelDescriptor(List submodelDescriptor) { - this.submodelDescriptor = submodelDescriptor; + public void setDescription(List descriptions) { + this.description = descriptions; } + @Override + public List getDisplayName() { + return displayName; + } @Override - public List getEndpoints() { - return endpoints; + public void setDisplayName(List displayNames) { + this.displayName = displayNames; } @Override - public void setEndpoints(List endpoints) { - this.endpoints = endpoints; + public List getExtensions() { + return extensions; } + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } public String toString() { return String.format( - "DefaultAssetAdministrationShellDescriptor (" + "id=%s," - + "description=%s," - + "displayName=%s," - + "submodelDescriptor=%s," - + ")", - this.id, this.description, this.displayName, this.submodelDescriptor); + "DefaultAssetAdministrationShellDescriptor (" + "administration=%s," + + "assetKind=%s," + + "assetType=%s," + + "endpoints=%s," + + "globalAssetId=%s," + + "idShort=%s," + + "id=%s," + + "specificAssetIds=%s," + + "submodelDescriptors=%s," + + ")", + this.administration, this.assetKind, this.assetType, this.endpoints, this.globalAssetId, this.idShort, this.id, + this.specificAssetIds, this.submodelDescriptors); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index 0dbc4be34..6126b80e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -15,18 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetInformationBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation * @@ -54,6 +52,14 @@ public class DefaultAssetInformation implements AssetInformation { public DefaultAssetInformation() {} + public DefaultAssetInformation(AssetInformation x) { + this.assetKind = x.getAssetKind(); + this.assetType = x.getAssetType(); + this.defaultThumbnail = x.getDefaultThumbnail(); + this.globalAssetId = x.getGlobalAssetId(); + this.specificAssetIds = x.getSpecificAssetIds(); + } + @Override public int hashCode() { return Objects.hash(this.assetKind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index c83be01c2..366919da3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BasicEventElementBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement * @@ -86,6 +87,26 @@ public class DefaultBasicEventElement implements BasicEventElement { public DefaultBasicEventElement() {} + public DefaultBasicEventElement(BasicEventElement x) { + this.direction = x.getDirection(); + this.lastUpdate = x.getLastUpdate(); + this.maxInterval = x.getMaxInterval(); + this.messageBroker = x.getMessageBroker(); + this.messageTopic = x.getMessageTopic(); + this.minInterval = x.getMinInterval(); + this.observed = x.getObserved(); + this.state = x.getState(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.observed, @@ -97,14 +118,14 @@ public int hashCode() { this.minInterval, this.maxInterval, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -126,14 +147,14 @@ public boolean equals(Object obj) { Objects.equals(this.minInterval, other.minInterval) && Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -227,36 +248,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -307,6 +298,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBasicEventElement (" + "observed=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index f0e59a60d..63822dc30 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -15,16 +15,17 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BlobBuilder; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Blob * @@ -70,19 +71,33 @@ public class DefaultBlob implements Blob { public DefaultBlob() {} + public DefaultBlob(Blob x) { + this.contentType = x.getContentType(); + this.value = x.getValue(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(Arrays.hashCode(this.value), this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -98,14 +113,14 @@ public boolean equals(Object obj) { return Arrays.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -139,36 +154,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -219,6 +204,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBlob (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 6ca35f6bf..0f3006313 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.CapabilityBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Capability * @@ -63,17 +64,29 @@ public class DefaultCapability implements Capability { public DefaultCapability() {} + public DefaultCapability(Capability x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -87,14 +100,14 @@ public boolean equals(Object obj) { } else { DefaultCapability other = (DefaultCapability) obj; return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -108,36 +121,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -188,6 +171,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultCapability (" diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 51949170b..14d41dbe6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ConceptDescriptionBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription * @@ -63,17 +64,29 @@ public class DefaultConceptDescription implements ConceptDescription { public DefaultConceptDescription() {} + public DefaultConceptDescription(ConceptDescription x) { + this.isCaseOf = x.getIsCaseOf(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.administration = x.getAdministration(); + this.id = x.getId(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.isCaseOf, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -87,14 +100,14 @@ public boolean equals(Object obj) { } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; return Objects.equals(this.isCaseOf, other.isCaseOf) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -108,16 +121,6 @@ public void setIsCaseOf(List isCaseOfs) { this.isCaseOf = isCaseOfs; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -188,6 +191,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultConceptDescription (" + "isCaseOf=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index b772cd0a6..42f57c645 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360 @@ -73,6 +74,21 @@ public class DefaultDataSpecificationIec61360 implements DataSpecificationIec613 public DefaultDataSpecificationIec61360() {} + public DefaultDataSpecificationIec61360(DataSpecificationIec61360 x) { + this.dataType = x.getDataType(); + this.definition = x.getDefinition(); + this.levelType = x.getLevelType(); + this.preferredName = x.getPreferredName(); + this.shortName = x.getShortName(); + this.sourceOfDefinition = x.getSourceOfDefinition(); + this.symbol = x.getSymbol(); + this.unit = x.getUnit(); + this.unitId = x.getUnitId(); + this.value = x.getValue(); + this.valueFormat = x.getValueFormat(); + this.valueList = x.getValueList(); + } + @Override public int hashCode() { return Objects.hash(this.preferredName, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java index c1a915ca5..4ae3f5454 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -15,27 +15,46 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DescriptorBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Descriptor + * + */ + @IRI("aas:Descriptor") public class DefaultDescriptor implements Descriptor { - @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") - protected List endpoints = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); - public DefaultDescriptor() { + public DefaultDescriptor() {} + + public DefaultDescriptor(Descriptor x) { + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.extensions = x.getExtensions(); } @Override public int hashCode() { - return Objects.hash(this.endpoints); + return Objects.hash(this.description, + this.displayName, + this.extensions); } @Override @@ -48,18 +67,49 @@ public boolean equals(Object obj) { return false; } else { DefaultDescriptor other = (DefaultDescriptor) obj; - return Objects.equals(this.endpoints, other.endpoints); + return Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); } } @Override - public List getEndpoints() { - return endpoints; + public List getDescription() { + return description; } @Override - public void setEndpoints(List endpoints) { - this.endpoints = endpoints; + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + public String toString() { + return String.format( + "DefaultDescriptor (" + "description=%s," + + "displayName=%s," + + "extensions=%s," + + ")", + this.description, this.displayName, this.extensions); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index 0235e810d..e279bbd7c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -15,15 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EmbeddedDataSpecificationBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification @@ -42,6 +41,11 @@ public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecificati public DefaultEmbeddedDataSpecification() {} + public DefaultEmbeddedDataSpecification(EmbeddedDataSpecification x) { + this.dataSpecification = x.getDataSpecification(); + this.dataSpecificationContent = x.getDataSpecificationContent(); + } + @Override public int hashCode() { return Objects.hash(this.dataSpecification, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java index 648e4859d..060c3a0e8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -15,28 +15,38 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EndpointBuilder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; -import java.util.Objects; + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Endpoint + * + */ @IRI("aas:Endpoint") public class DefaultEndpoint implements Endpoint { - @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/_interface") - protected String interfaceValue; + @IRI("https://admin-shell.io/aas/3/0/Endpoint/_interface") + protected String _interface; - @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + @IRI("https://admin-shell.io/aas/3/0/Endpoint/protocolInformation") protected ProtocolInformation protocolInformation; - public DefaultEndpoint() { + public DefaultEndpoint() {} + + public DefaultEndpoint(Endpoint x) { + this._interface = x.get_interface(); + this.protocolInformation = x.getProtocolInformation(); } @Override public int hashCode() { - return Objects.hash(this.interfaceValue, + return Objects.hash(this._interface, this.protocolInformation); } @@ -50,19 +60,19 @@ public boolean equals(Object obj) { return false; } else { DefaultEndpoint other = (DefaultEndpoint) obj; - return Objects.equals(this.interfaceValue, other.interfaceValue) && + return Objects.equals(this._interface, other._interface) && Objects.equals(this.protocolInformation, other.protocolInformation); } } @Override - public String getInterface() { - return interfaceValue; + public String get_interface() { + return _interface; } @Override - public void setInterface(String interfaceValue) { - this.interfaceValue = interfaceValue; + public void set_interface(String _interface) { + this._interface = _interface; } @Override @@ -75,6 +85,14 @@ public void setProtocolInformation(ProtocolInformation protocolInformation) { this.protocolInformation = protocolInformation; } + public String toString() { + return String.format( + "DefaultEndpoint (" + "_interface=%s," + + "protocolInformation=%s," + + ")", + this._interface, this.protocolInformation); + } + /** * This builder class can be used to construct a DefaultEndpoint bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index 2b38425b8..c2bb3ae38 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EntityBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Entity * @@ -74,6 +75,22 @@ public class DefaultEntity implements Entity { public DefaultEntity() {} + public DefaultEntity(Entity x) { + this.entityType = x.getEntityType(); + this.globalAssetId = x.getGlobalAssetId(); + this.specificAssetIds = x.getSpecificAssetIds(); + this.statements = x.getStatements(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.statements, @@ -81,14 +98,14 @@ public int hashCode() { this.globalAssetId, this.specificAssetIds, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -106,14 +123,14 @@ public boolean equals(Object obj) { Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -167,36 +184,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -247,6 +234,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultEntity (" + "statements=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 30d5f6377..27e72bdfd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -15,18 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EnvironmentBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Environment * @@ -47,6 +45,12 @@ public class DefaultEnvironment implements Environment { public DefaultEnvironment() {} + public DefaultEnvironment(Environment x) { + this.assetAdministrationShells = x.getAssetAdministrationShells(); + this.conceptDescriptions = x.getConceptDescriptions(); + this.submodels = x.getSubmodels(); + } + @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index 750f1c5ff..ada88d61c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -15,15 +15,15 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.EventPayload; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EventPayloadBuilder; - import java.util.Arrays; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.EventPayload * @@ -59,6 +59,17 @@ public class DefaultEventPayload implements EventPayload { public DefaultEventPayload() {} + public DefaultEventPayload(EventPayload x) { + this.observableReference = x.getObservableReference(); + this.observableSemanticId = x.getObservableSemanticId(); + this.payload = x.getPayload(); + this.source = x.getSource(); + this.sourceSemanticId = x.getSourceSemanticId(); + this.subjectId = x.getSubjectId(); + this.timeStamp = x.getTimeStamp(); + this.topic = x.getTopic(); + } + @Override public int hashCode() { return Objects.hash(this.source, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index eb013ed1f..fd01dbfc2 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -15,17 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ExtensionBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Extension * @@ -53,7 +52,18 @@ public class DefaultExtension implements Extension { @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() {} + public DefaultExtension() { + this.valueType = DataTypeDefXsd.STRING; + } + + public DefaultExtension(Extension x) { + this.name = x.getName(); + this.refersTo = x.getRefersTo(); + this.value = x.getValue(); + this.valueType = x.getValueType(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + } @Override public int hashCode() { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 52f767e6e..678fde2fe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.FileBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.File * @@ -68,19 +69,33 @@ public class DefaultFile implements File { public DefaultFile() {} + public DefaultFile(File x) { + this.contentType = x.getContentType(); + this.value = x.getValue(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.value, this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -96,14 +111,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -137,36 +152,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -217,6 +202,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultFile (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index 45d6d6f7e..ce3564955 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -15,14 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.KeyBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Key * @@ -40,6 +40,11 @@ public class DefaultKey implements Key { public DefaultKey() {} + public DefaultKey(Key x) { + this.type = x.getType(); + this.value = x.getValue(); + } + @Override public int hashCode() { return Objects.hash(this.type, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index 4c8a473b9..df540bb93 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringDefinitionTypeIec61360Builder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360 @@ -40,6 +41,11 @@ public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefini public DefaultLangStringDefinitionTypeIec61360() {} + public DefaultLangStringDefinitionTypeIec61360(LangStringDefinitionTypeIec61360 x) { + this.language = x.getLanguage(); + this.text = x.getText(); + } + @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index cf01867c5..f9230ad7e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringNameTypeBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType * @@ -39,6 +40,11 @@ public class DefaultLangStringNameType implements LangStringNameType { public DefaultLangStringNameType() {} + public DefaultLangStringNameType(LangStringNameType x) { + this.language = x.getLanguage(); + this.text = x.getText(); + } + @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 40be9c6fc..00e4ea4ce 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringPreferredNameTypeIec61360Builder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360 @@ -40,6 +41,11 @@ public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPre public DefaultLangStringPreferredNameTypeIec61360() {} + public DefaultLangStringPreferredNameTypeIec61360(LangStringPreferredNameTypeIec61360 x) { + this.language = x.getLanguage(); + this.text = x.getText(); + } + @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index f33fc73ee..326f7d300 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringShortNameTypeIec61360Builder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360 @@ -40,6 +41,11 @@ public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNa public DefaultLangStringShortNameTypeIec61360() {} + public DefaultLangStringShortNameTypeIec61360(LangStringShortNameTypeIec61360 x) { + this.language = x.getLanguage(); + this.text = x.getText(); + } + @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index 196784d6e..12524954e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LangStringTextTypeBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType * @@ -39,6 +40,11 @@ public class DefaultLangStringTextType implements LangStringTextType { public DefaultLangStringTextType() {} + public DefaultLangStringTextType(LangStringTextType x) { + this.language = x.getLanguage(); + this.text = x.getText(); + } + @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 5cf2b4ecd..987fcd731 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.LevelTypeBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.LevelType * @@ -46,6 +47,13 @@ public class DefaultLevelType implements LevelType { public DefaultLevelType() {} + public DefaultLevelType(LevelType x) { + this.max = x.getMax(); + this.min = x.getMin(); + this.nom = x.getNom(); + this.typ = x.getTyp(); + } + @Override public int hashCode() { return Objects.hash(this.min, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 16705fbb2..015eed191 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.MultiLanguagePropertyBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty * @@ -68,19 +69,33 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { public DefaultMultiLanguageProperty() {} + public DefaultMultiLanguageProperty(MultiLanguageProperty x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.value = x.getValue(); + this.valueId = x.getValueId(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -96,14 +111,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -137,36 +152,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -217,6 +202,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultMultiLanguageProperty (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index eb713de68..cddee6979 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Operation * @@ -71,20 +72,35 @@ public class DefaultOperation implements Operation { public DefaultOperation() {} + public DefaultOperation(Operation x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.inoutputVariables = x.getInoutputVariables(); + this.inputVariables = x.getInputVariables(); + this.outputVariables = x.getOutputVariables(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.inputVariables, this.outputVariables, this.inoutputVariables, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -101,14 +117,14 @@ public boolean equals(Object obj) { Objects.equals(this.outputVariables, other.outputVariables) && Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -152,36 +168,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -232,6 +218,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultOperation (" + "inputVariables=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index 17f42b008..eeb59a52d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -15,14 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationVariableBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable * @@ -38,6 +38,10 @@ public class DefaultOperationVariable implements OperationVariable { public DefaultOperationVariable() {} + public DefaultOperationVariable(OperationVariable x) { + this.value = x.getValue(); + } + @Override public int hashCode() { return Objects.hash(this.value); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index 7917d7d94..acca03333 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.PropertyBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Property * @@ -71,20 +72,35 @@ public class DefaultProperty implements Property { public DefaultProperty() {} + public DefaultProperty(Property x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.value = x.getValue(); + this.valueId = x.getValueId(); + this.valueType = x.getValueType(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.valueType, this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -101,14 +117,14 @@ public boolean equals(Object obj) { Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -152,36 +168,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -232,6 +218,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultProperty (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java index 9d5dfa3a7..4b0b7a105 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -15,35 +15,51 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; - +import java.util.ArrayList; import java.util.List; import java.util.Objects; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation + * + */ + @IRI("aas:ProtocolInformation") public class DefaultProtocolInformation implements ProtocolInformation { - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/href") - protected String href; - - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocol") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") protected String endpointProtocol; - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/endpointProtocolVersion") - protected List endpointProtocolVersion; + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") + protected List endpointProtocolVersion = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") + protected String href; - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocol") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") protected String subprotocol; - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBody") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") protected String subprotocolBody; - @IRI("https://admin-shell.io/aas/3/0/RC02/ProtocolInformation/subprotocolBodyEncoding") + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") protected String subprotocolBodyEncoding; - public DefaultProtocolInformation() { + public DefaultProtocolInformation() {} + + public DefaultProtocolInformation(ProtocolInformation x) { + this.endpointProtocol = x.getEndpointProtocol(); + this.endpointProtocolVersion = x.getEndpointProtocolVersion(); + this.href = x.getHref(); + this.subprotocol = x.getSubprotocol(); + this.subprotocolBody = x.getSubprotocolBody(); + this.subprotocolBodyEncoding = x.getSubprotocolBodyEncoding(); } @Override @@ -101,8 +117,8 @@ public List getEndpointProtocolVersion() { } @Override - public void setEndpointProtocolVersion(List endpointProtocolVersion) { - this.endpointProtocolVersion = endpointProtocolVersion; + public void setEndpointProtocolVersion(List endpointProtocolVersions) { + this.endpointProtocolVersion = endpointProtocolVersions; } @Override @@ -135,6 +151,19 @@ public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { this.subprotocolBodyEncoding = subprotocolBodyEncoding; } + public String toString() { + return String.format( + "DefaultProtocolInformation (" + "href=%s," + + "endpointProtocol=%s," + + "endpointProtocolVersion=%s," + + "subprotocol=%s," + + "subprotocolBody=%s," + + "subprotocolBodyEncoding=%s," + + ")", + this.href, this.endpointProtocol, this.endpointProtocolVersion, this.subprotocol, this.subprotocolBody, + this.subprotocolBodyEncoding); + } + /** * This builder class can be used to construct a DefaultProtocolInformation bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 4a3447a43..4ef4f2d37 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -15,18 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.QualifierBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Qualifier * @@ -58,7 +56,19 @@ public class DefaultQualifier implements Qualifier { @IRI("https://admin-shell.io/aas/3/0/Qualifier/valueType") protected DataTypeDefXsd valueType; - public DefaultQualifier() {} + public DefaultQualifier() { + this.kind = QualifierKind.CONCEPT_QUALIFIER; + } + + public DefaultQualifier(Qualifier x) { + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.kind = x.getKind(); + this.type = x.getType(); + this.value = x.getValue(); + this.valueId = x.getValueId(); + this.valueType = x.getValueType(); + } @Override public int hashCode() { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 475339717..525b31942 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RangeBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Range * @@ -71,20 +72,35 @@ public class DefaultRange implements Range { public DefaultRange() {} + public DefaultRange(Range x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.max = x.getMax(); + this.min = x.getMin(); + this.valueType = x.getValueType(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + @Override public int hashCode() { return Objects.hash(this.valueType, this.min, this.max, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -101,14 +117,14 @@ public boolean equals(Object obj) { Objects.equals(this.min, other.min) && Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -152,36 +168,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -232,6 +218,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRange (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index ceed8d70d..ad3389db0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -15,17 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ReferenceBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Reference * @@ -46,6 +45,12 @@ public class DefaultReference implements Reference { public DefaultReference() {} + public DefaultReference(Reference x) { + this.keys = x.getKeys(); + this.referredSemanticId = x.getReferredSemanticId(); + this.type = x.getType(); + } + @Override public int hashCode() { return Objects.hash(this.type, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index da64e65ec..8c3a4537c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ReferenceElementBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement * @@ -66,18 +67,31 @@ public class DefaultReferenceElement implements ReferenceElement { public DefaultReferenceElement() {} + public DefaultReferenceElement(ReferenceElement x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.value = x.getValue(); + } + @Override public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -92,14 +106,14 @@ public boolean equals(Object obj) { DefaultReferenceElement other = (DefaultReferenceElement) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -123,36 +137,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -203,6 +187,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultReferenceElement (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index d151659c5..0a28e723b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RelationshipElementBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement * @@ -69,19 +70,33 @@ public class DefaultRelationshipElement implements RelationshipElement { public DefaultRelationshipElement() {} + public DefaultRelationshipElement(RelationshipElement x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.first = x.getFirst(); + this.second = x.getSecond(); + } + @Override public int hashCode() { return Objects.hash(this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -97,14 +112,14 @@ public boolean equals(Object obj) { return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -138,36 +153,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -218,6 +203,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRelationshipElement (" + "first=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index 068c2ad83..6b3b72075 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -15,13 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ResourceBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Resource * @@ -40,6 +41,11 @@ public class DefaultResource implements Resource { public DefaultResource() {} + public DefaultResource(Resource x) { + this.contentType = x.getContentType(); + this.path = x.getPath(); + } + @Override public int hashCode() { return Objects.hash(this.path, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java index 53122fe0c..6971280f8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -15,16 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SpecificAssetIdBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId * @@ -51,6 +51,14 @@ public class DefaultSpecificAssetId implements SpecificAssetId { public DefaultSpecificAssetId() {} + public DefaultSpecificAssetId(SpecificAssetId x) { + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.externalSubjectId = x.getExternalSubjectId(); + this.name = x.getName(); + this.value = x.getValue(); + } + @Override public int hashCode() { return Objects.hash(this.name, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index b5697a48f..7a3f16df9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Submodel * @@ -72,15 +73,29 @@ public class DefaultSubmodel implements Submodel { @IRI("https://admin-shell.io/aas/3/0/Submodel/submodelElements") protected List submodelElements = new ArrayList<>(); - public DefaultSubmodel() {} + public DefaultSubmodel() { + this.kind = ModellingKind.INSTANCE; + } + + public DefaultSubmodel(Submodel x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.kind = x.getKind(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.administration = x.getAdministration(); + this.id = x.getId(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.submodelElements = x.getSubmodelElements(); + } @Override public int hashCode() { return Objects.hash(this.submodelElements, - this.embeddedDataSpecifications, - this.kind, - this.semanticId, - this.supplementalSemanticIds, this.administration, this.id, this.category, @@ -88,7 +103,11 @@ public int hashCode() { this.displayName, this.description, this.extensions, - this.qualifiers); + this.embeddedDataSpecifications, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers, + this.kind); } @Override @@ -102,10 +121,6 @@ public boolean equals(Object obj) { } else { DefaultSubmodel other = (DefaultSubmodel) obj; return Objects.equals(this.submodelElements, other.submodelElements) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && @@ -113,7 +128,11 @@ public boolean equals(Object obj) { Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.qualifiers, other.qualifiers); + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers) && + Objects.equals(this.kind, other.kind); } } @@ -127,46 +146,6 @@ public void setSubmodelElements(List submodelElements) { this.submodelElements = submodelElements; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -237,6 +216,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + @Override public List getQualifiers() { return qualifiers; @@ -247,6 +256,16 @@ public void setQualifiers(List qualifiers) { this.qualifiers = qualifiers; } + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + public String toString() { return String.format( "DefaultSubmodel (" + "submodelElements=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java index 86a5b2184..cda3b8b08 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -19,51 +19,72 @@ import java.util.List; import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelDescriptorBuilder; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor + * + */ @IRI("aas:SubmodelDescriptor") public class DefaultSubmodelDescriptor implements SubmodelDescriptor { - @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") - protected List endpoints = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/administration") - protected AdministrativeInformation administration; + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/description") - protected List description; + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/displayName") - protected List displayName; + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration") + protected AdministrativeInformation administration; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/idShort") - protected String idShort; + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints") + protected List endpoints = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/id") protected String id; - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/semanticId") + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId") protected Reference semanticId; - public DefaultSubmodelDescriptor() { + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId") + protected List supplementalSemanticId = new ArrayList<>(); + + public DefaultSubmodelDescriptor() {} + + public DefaultSubmodelDescriptor(SubmodelDescriptor x) { + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.extensions = x.getExtensions(); + this.administration = x.getAdministration(); + this.endpoints = x.getEndpoints(); + this.id = x.getId(); + this.idShort = x.getIdShort(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticId = x.getSupplementalSemanticId(); } @Override public int hashCode() { return Objects.hash(this.administration, - this.description, - this.displayName, + this.endpoints, this.idShort, this.id, this.semanticId, - this.endpoints); + this.supplementalSemanticId, + this.description, + this.displayName, + this.extensions); } @Override @@ -77,12 +98,14 @@ public boolean equals(Object obj) { } else { DefaultSubmodelDescriptor other = (DefaultSubmodelDescriptor) obj; return Objects.equals(this.administration, other.administration) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.endpoints, other.endpoints) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.id, other.id) && Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.endpoints, other.endpoints); + Objects.equals(this.supplementalSemanticId, other.supplementalSemanticId) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); } } @@ -97,23 +120,13 @@ public void setAdministration(AdministrativeInformation administration) { } @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List description) { - this.description = description; - } - - @Override - public List getDisplayName() { - return displayName; + public List getEndpoints() { + return endpoints; } @Override - public void setDisplayName(List displayName) { - this.displayName = displayName; + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; } @Override @@ -147,27 +160,57 @@ public void setSemanticId(Reference semanticId) { } @Override - public List getEndpoints() { - return endpoints; + public List getSupplementalSemanticId() { + return supplementalSemanticId; } @Override - public void setEndpoints(List endpoints) { - this.endpoints = endpoints; + public void setSupplementalSemanticId(List supplementalSemanticIds) { + this.supplementalSemanticId = supplementalSemanticIds; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; } public String toString() { return String.format( - "DefaultSubmodel (" + "id=%s," - + "endpoints=%s," - + "displayName=%s," - + "description=%s," - + "endpoints=%s," - + ")", - this.id, this.endpoints, this.displayName, this.description, this.endpoints); + "DefaultSubmodelDescriptor (" + "administration=%s," + + "endpoints=%s," + + "idShort=%s," + + "id=%s," + + "semanticId=%s," + + "supplementalSemanticId=%s," + + ")", + this.administration, this.endpoints, this.idShort, this.id, this.semanticId, this.supplementalSemanticId); } - /** * This builder class can be used to construct a DefaultSubmodelDescriptor bean. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index a81775b3b..0704959be 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection @@ -67,18 +68,31 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti public DefaultSubmodelElementCollection() {} + public DefaultSubmodelElementCollection(SubmodelElementCollection x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.value = x.getValue(); + } + @Override public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -93,14 +107,14 @@ public boolean equals(Object obj) { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -124,36 +138,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -204,6 +188,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultSubmodelElementCollection (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 221b3fd75..6e366cd1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -15,15 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementListBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList * @@ -75,7 +76,26 @@ public class DefaultSubmodelElementList implements SubmodelElementList { @IRI("https://admin-shell.io/aas/3/0/SubmodelElementList/valueTypeListElement") protected DataTypeDefXsd valueTypeListElement; - public DefaultSubmodelElementList() {} + public DefaultSubmodelElementList() { + this.orderRelevant = Boolean.TRUE; + } + + public DefaultSubmodelElementList(SubmodelElementList x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.orderRelevant = x.getOrderRelevant(); + this.semanticIdListElement = x.getSemanticIdListElement(); + this.typeValueListElement = x.getTypeValueListElement(); + this.value = x.getValue(); + this.valueTypeListElement = x.getValueTypeListElement(); + } @Override public int hashCode() { @@ -85,14 +105,14 @@ public int hashCode() { this.valueTypeListElement, this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -111,14 +131,14 @@ public boolean equals(Object obj) { Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -182,36 +202,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -262,6 +252,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultSubmodelElementList (" + "orderRelevant=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index 95df776d9..b955fec98 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -15,16 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueList; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ValueListBuilder; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ValueList * @@ -39,6 +39,10 @@ public class DefaultValueList implements ValueList { public DefaultValueList() {} + public DefaultValueList(ValueList x) { + this.valueReferencePairs = x.getValueReferencePairs(); + } + @Override public int hashCode() { return Objects.hash(this.valueReferencePairs); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index 752281744..a41506105 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -15,14 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ValueReferencePairBuilder; - import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + /** * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair * @@ -41,6 +41,11 @@ public class DefaultValueReferencePair implements ValueReferencePair { public DefaultValueReferencePair() {} + public DefaultValueReferencePair(ValueReferencePair x) { + this.value = x.getValue(); + this.valueId = x.getValueId(); + } + @Override public int hashCode() { return Objects.hash(this.value, From 536e3596b2006816385fd6be1768c8305902281d Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 12:26:36 +0200 Subject: [PATCH 34/91] update part 2 classes --- .../dataformat/json/mixins/EndpointMixin.java | 33 ++ ...rationShellDescriptorDeserializerTest.java | 4 +- .../v3/dataformat/json/TestDataHelper.java | 2 +- .../AnnotatedRelationshipElementMetadata.java | 32 ++ .../AnnotatedRelationshipElementValue.java | 87 +++++ .../AssetAdministrationShellDescriptor.java | 123 +++--- .../AssetAdministrationShellMetadata.java | 53 +++ .../v3/model/BasicEventElementMetadata.java | 153 ++++++++ .../v3/model/BasicEventElementValue.java | 51 +++ .../aas4j/v3/model/BlobMetadata.java | 32 ++ .../digitaltwin/aas4j/v3/model/BlobValue.java | 67 ++++ .../aas4j/v3/model/CapabilityMetadata.java | 32 ++ .../aas4j/v3/model/Descriptor.java | 58 ++- .../digitaltwin/aas4j/v3/model/Endpoint.java | 32 +- .../aas4j/v3/model/EntityMetadata.java | 32 ++ .../aas4j/v3/model/EntityValue.java | 102 +++++ .../aas4j/v3/model/ExecutionState.java | 60 +++ .../aas4j/v3/model/FileMetadata.java | 32 ++ .../digitaltwin/aas4j/v3/model/FileValue.java | 67 ++++ .../aas4j/v3/model/LangString.java | 96 +++++ .../digitaltwin/aas4j/v3/model/Message.java | 101 +++++ .../aas4j/v3/model/MessageType.java | 55 +++ .../model/MultiLanguagePropertyMetadata.java | 32 ++ .../v3/model/MultiLanguagePropertyValue.java | 32 ++ .../aas4j/v3/model/NumberValue.java | 32 ++ .../aas4j/v3/model/OperationHandle.java | 67 ++++ .../aas4j/v3/model/OperationMetadata.java | 32 ++ .../aas4j/v3/model/OperationRequest.java | 102 +++++ .../v3/model/OperationRequestValueOnly.java | 102 +++++ .../aas4j/v3/model/OperationResult.java | 118 ++++++ .../v3/model/OperationResultValueOnly.java | 119 ++++++ .../aas4j/v3/model/PackageDescription.java | 68 ++++ .../aas4j/v3/model/PropertyMetadata.java | 50 +++ .../aas4j/v3/model/RangeMetadata.java | 50 +++ .../aas4j/v3/model/RangeValue.java | 68 ++++ .../v3/model/ReferenceElementMetadata.java | 32 ++ .../aas4j/v3/model/ReferenceElementValue.java | 32 ++ .../aas4j/v3/model/ReferenceValue.java | 52 +++ .../v3/model/RelationshipElementMetadata.java | 32 ++ .../v3/model/RelationshipElementValue.java | 67 ++++ .../digitaltwin/aas4j/v3/model/Result.java | 68 ++++ .../aas4j/v3/model/StringValue.java | 32 ++ .../v3/model/SubmodelElementAttributes.java | 64 ++++ .../SubmodelElementCollectionMetadata.java | 32 ++ .../v3/model/SubmodelElementListMetadata.java | 107 ++++++ .../v3/model/SubmodelElementListValue.java | 32 ++ .../aas4j/v3/model/SubmodelMetadata.java | 50 +++ ...tedRelationshipElementMetadataBuilder.java | 203 ++++++++++ ...otatedRelationshipElementValueBuilder.java | 71 ++++ ...setAdministrationShellMetadataBuilder.java | 181 +++++++++ .../BasicEventElementMetadataBuilder.java | 357 +++++++++++++++++ .../BasicEventElementValueBuilder.java | 49 +++ .../v3/model/builder/BlobMetadataBuilder.java | 202 ++++++++++ .../v3/model/builder/BlobValueBuilder.java | 47 +++ .../builder/CapabilityMetadataBuilder.java | 203 ++++++++++ .../DataSpecificationPhysicalUnitBuilder.java | 104 ----- .../model/builder/EntityMetadataBuilder.java | 203 ++++++++++ .../v3/model/builder/EntityValueBuilder.java | 92 +++++ .../v3/model/builder/FileMetadataBuilder.java | 202 ++++++++++ .../v3/model/builder/FileValueBuilder.java | 47 +++ .../v3/model/builder/MessageBuilder.java | 69 ++++ .../MultiLanguagePropertyMetadataBuilder.java | 203 ++++++++++ .../MultiLanguagePropertyValueBuilder.java | 26 ++ .../v3/model/builder/NumberValueBuilder.java | 25 ++ .../model/builder/OperationHandleBuilder.java | 48 +++ .../builder/OperationMetadataBuilder.java | 203 ++++++++++ .../builder/OperationRequestBuilder.java | 71 ++++ .../OperationRequestValueOnlyBuilder.java | 71 ++++ .../model/builder/OperationResultBuilder.java | 81 ++++ .../OperationResultValueOnlyBuilder.java | 137 +++++++ .../builder/PackageDescriptionBuilder.java | 60 +++ .../builder/PropertyMetadataBuilder.java | 214 +++++++++++ .../model/builder/RangeMetadataBuilder.java | 213 +++++++++++ .../v3/model/builder/RangeValueBuilder.java | 48 +++ .../ReferenceElementMetadataBuilder.java | 203 ++++++++++ .../builder/ReferenceElementValueBuilder.java | 49 +++ .../model/builder/ReferenceValueBuilder.java | 49 +++ .../RelationshipElementMetadataBuilder.java | 203 ++++++++++ .../RelationshipElementValueBuilder.java | 48 +++ .../aas4j/v3/model/builder/ResultBuilder.java | 59 +++ .../v3/model/builder/StringValueBuilder.java | 25 ++ .../SubmodelElementAttributesBuilder.java | 203 ++++++++++ ...modelElementCollectionMetadataBuilder.java | 203 ++++++++++ .../SubmodelElementListMetadataBuilder.java | 247 ++++++++++++ .../SubmodelElementListValueBuilder.java | 26 ++ .../builder/SubmodelMetadataBuilder.java | 225 +++++++++++ ...tAnnotatedRelationshipElementMetadata.java | 242 ++++++++++++ ...aultAnnotatedRelationshipElementValue.java | 131 +++++++ ...faultAssetAdministrationShellMetadata.java | 225 +++++++++++ .../DefaultBasicEventElementMetadata.java | 359 ++++++++++++++++++ .../impl/DefaultBasicEventElementValue.java | 96 +++++ .../v3/model/impl/DefaultBlobMetadata.java | 241 ++++++++++++ .../aas4j/v3/model/impl/DefaultBlobValue.java | 111 ++++++ .../model/impl/DefaultCapabilityMetadata.java | 241 ++++++++++++ .../DefaultDataSpecificationPhysicalUnit.java | 233 ------------ .../v3/model/impl/DefaultEntityMetadata.java | 241 ++++++++++++ .../v3/model/impl/DefaultEntityValue.java | 147 +++++++ .../v3/model/impl/DefaultFileMetadata.java | 241 ++++++++++++ .../aas4j/v3/model/impl/DefaultFileValue.java | 111 ++++++ .../aas4j/v3/model/impl/DefaultMessage.java | 145 +++++++ .../DefaultMultiLanguagePropertyMetadata.java | 242 ++++++++++++ .../DefaultMultiLanguagePropertyValue.java | 81 ++++ .../v3/model/impl/DefaultNumberValue.java | 80 ++++ .../v3/model/impl/DefaultOperationHandle.java | 111 ++++++ .../model/impl/DefaultOperationMetadata.java | 241 ++++++++++++ .../model/impl/DefaultOperationRequest.java | 146 +++++++ .../DefaultOperationRequestValueOnly.java | 147 +++++++ .../v3/model/impl/DefaultOperationResult.java | 162 ++++++++ .../impl/DefaultOperationResultValueOnly.java | 164 ++++++++ .../model/impl/DefaultPackageDescription.java | 113 ++++++ .../model/impl/DefaultPropertyMetadata.java | 256 +++++++++++++ .../v3/model/impl/DefaultRangeMetadata.java | 256 +++++++++++++ .../v3/model/impl/DefaultRangeValue.java | 112 ++++++ .../impl/DefaultReferenceElementMetadata.java | 241 ++++++++++++ .../impl/DefaultReferenceElementValue.java | 97 +++++ .../v3/model/impl/DefaultReferenceValue.java | 96 +++++ .../DefaultRelationshipElementMetadata.java | 242 ++++++++++++ .../impl/DefaultRelationshipElementValue.java | 111 ++++++ .../aas4j/v3/model/impl/DefaultResult.java | 113 ++++++ .../v3/model/impl/DefaultStringValue.java | 80 ++++ .../DefaultSubmodelElementAttributes.java | 241 ++++++++++++ ...aultSubmodelElementCollectionMetadata.java | 242 ++++++++++++ .../DefaultSubmodelElementListMetadata.java | 308 +++++++++++++++ .../impl/DefaultSubmodelElementListValue.java | 80 ++++ .../model/impl/DefaultSubmodelMetadata.java | 272 +++++++++++++ 125 files changed, 14336 insertions(+), 408 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java new file mode 100644 index 000000000..42cf4b58b --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java @@ -0,0 +1,33 @@ +/* + * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; + +import java.util.List; + +public interface EndpointMixin { + + + @JsonProperty("interface") + String get_interface(); + + @JsonProperty("interface") + void set_interface(String _interface); + +} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index fd950096c..da17bd88c 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -51,12 +51,12 @@ public static AssetAdministrationShellDescriptor createAasDescriptor() { .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) .description(TestDataHelper.DEFAULT_DESCRIPTION) .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .identification(TestDataHelper.DEFAULT_IDENTIFICATION) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) .idShort(TestDataHelper.DEFAULT_ID_SHORT) .specificAssetIds(List.of(specificAssetId)) .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) .globalAssetId("defaultGlobalAssetId") - .submodelDescriptor(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); + .submodelDescriptors(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); } @Test diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index af0c2dc41..36220a8da 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -58,7 +58,7 @@ public static DefaultEndpoint.Builder createEndpointBuilder() { return new DefaultEndpoint.Builder() .protocolInformation(createProtocolInformationBuilder().build()) - .withInterface(DEFAULT_INTERFACE_VALUE); + ._interface(DEFAULT_INTERFACE_VALUE); } public static Key createKey(KeyTypes type, String value) { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java new file mode 100644 index 000000000..e605dd7d4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAnnotatedRelationshipElementMetadata.class) +}) +public interface AnnotatedRelationshipElementMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java new file mode 100644 index 000000000..380959b82 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAnnotatedRelationshipElementValue.class) +}) +public interface AnnotatedRelationshipElementValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first + * + * @return Returns the ReferenceValue for the property first. + */ + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first") + ReferenceValue getFirst(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first + * + * @param first desired value for the property first. + */ + void setFirst(ReferenceValue first); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second + * + * @return Returns the ReferenceValue for the property second. + */ + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second") + ReferenceValue getSecond(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second + * + * @param second desired value for the property second. + */ + void setSecond(ReferenceValue second); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation + * + * @return Returns the List of Strings for the property annotation. + */ + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation") + List getAnnotation(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation + * + * @param annotations desired value for the property annotation. + */ + void setAnnotation(List annotations); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java index c9c019409..5db592f32 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -1,6 +1,7 @@ /* - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -14,11 +15,14 @@ package org.eclipse.digitaltwin.aas4j.v3.model; +import java.util.List; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; -import java.util.List; /** */ @@ -29,16 +33,18 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration * * @return Returns the AdministrativeInformation for the property administration. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration") AdministrativeInformation getAdministration(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/administration + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration * * @param administration desired value for the property administration. */ @@ -46,51 +52,75 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind + * + * @return Returns the AssetKind for the property assetKind. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind") + AssetKind getAssetKind(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind * - * @return Returns the LangStringSet for the property description. + * @param assetKind desired value for the property assetKind. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description") - List getDescription(); + void setAssetKind(AssetKind assetKind); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/description + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType * - * @param description desired value for the property description. + * @return Returns the String for the property assetType. */ - void setDescription(List description); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType") + String getAssetType(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType * - * @return Returns the LangStringSet for the property displayName. + * @param assetType desired value for the property assetType. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName") - List getDisplayName(); + void setAssetType(String assetType); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/displayName + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints * - * @param displayName desired value for the property displayName. + * @return Returns the List of Endpoints for the property endpoints. */ - void setDisplayName(List displayName); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints") + List getEndpoints(); + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints + * + * @param endpoints desired value for the property endpoints. + */ + void setEndpoints(List endpoints); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId * - * @return Returns the String for the property idShort. + * @return Returns the String for the property globalAssetId. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId") String getGlobalAssetId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/globalAssetId + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId * * @param globalAssetId desired value for the property globalAssetId. */ @@ -98,16 +128,16 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort * * @return Returns the String for the property idShort. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort") String getIdShort(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/idShort + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort * * @param idShort desired value for the property idShort. */ @@ -115,34 +145,35 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id * - * @return Returns the String for the property identification. + * @return Returns the String for the property id. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id") String getId(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/SubmodelDescriptor/id + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id * - * @param id desired value for the property identification. + * @param id desired value for the property id. */ void setId(String id); - /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetId + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds * - * @return Returns the String for the property specificAssetId. + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds") + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds") List getSpecificAssetIds(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/specificAssetIds + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds * * @param specificAssetIds desired value for the property specificAssetIds. */ @@ -150,19 +181,21 @@ public interface AssetAdministrationShellDescriptor extends Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors * - * @return Returns the String for the property submodelDescriptor. + * @return Returns the List of SubmodelDescriptors for the property submodelDescriptors. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor") - List getSubmodelDescriptor(); + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors") + List getSubmodelDescriptors(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/AssetAdministrationShellDescriptor/submodelDescriptor + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors * - * @param submodelDescriptor desired value for the property submodelDescriptor. + * @param submodelDescriptors desired value for the property submodelDescriptors. */ - void setSubmodelDescriptor(List submodelDescriptor); + void setSubmodelDescriptors(List submodelDescriptors); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java new file mode 100644 index 000000000..e67c00d7e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAssetAdministrationShellMetadata.class) +}) +public interface AssetAdministrationShellMetadata extends Identifiable, HasDataSpecification { + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom + * + * @return Returns the List of References for the property derivedFrom. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom") + List getDerivedFrom(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom + * + * @param derivedFroms desired value for the property derivedFrom. + */ + void setDerivedFrom(List derivedFroms); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java new file mode 100644 index 000000000..0f9266596 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBasicEventElementMetadata.class) +}) +public interface BasicEventElementMetadata extends SubmodelElementAttributes { + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction + * + * @return Returns the List of Directions for the property direction. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction") + List getDirection(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction + * + * @param directions desired value for the property direction. + */ + void setDirection(List directions); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state + * + * @return Returns the List of StateOfEvents for the property state. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state") + List getState(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state + * + * @param states desired value for the property state. + */ + void setState(List states); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker + * + * @return Returns the List of References for the property messageBroker. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker") + List getMessageBroker(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker + * + * @param messageBrokers desired value for the property messageBroker. + */ + void setMessageBroker(List messageBrokers); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic + * + * @return Returns the List of Strings for the property messageTopic. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic") + List getMessageTopic(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic + * + * @param messageTopics desired value for the property messageTopic. + */ + void setMessageTopic(List messageTopics); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate + * + * @return Returns the List of Strings for the property lastUpdate. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate") + List getLastUpdate(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate + * + * @param lastUpdates desired value for the property lastUpdate. + */ + void setLastUpdate(List lastUpdates); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval + * + * @return Returns the List of Strings for the property minInterval. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval") + List getMinInterval(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval + * + * @param minIntervals desired value for the property minInterval. + */ + void setMinInterval(List minIntervals); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval + * + * @return Returns the List of Strings for the property maxInterval. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval") + List getMaxInterval(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval + * + * @param maxIntervals desired value for the property maxInterval. + */ + void setMaxInterval(List maxIntervals); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java new file mode 100644 index 000000000..5821d0683 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBasicEventElementValue.class) +}) +public interface BasicEventElementValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementValue/observed + * + * @return Returns the List of ReferenceValues for the property observed. + */ + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementValue/observed") + List getObserved(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BasicEventElementValue/observed + * + * @param observeds desired value for the property observed. + */ + void setObserved(List observeds); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java new file mode 100644 index 000000000..a8618e898 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBlobMetadata.class) +}) +public interface BlobMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java new file mode 100644 index 000000000..6f44bab2e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBlobValue.class) +}) +public interface BlobValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/BlobValue/mimeType + * + * @return Returns the String for the property mimeType. + */ + @IRI("https://admin-shell.io/aas/3/0/BlobValue/mimeType") + String getMimeType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BlobValue/mimeType + * + * @param mimeType desired value for the property mimeType. + */ + void setMimeType(String mimeType); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BlobValue/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/BlobValue/value") + String getValue(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BlobValue/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java new file mode 100644 index 000000000..419061f90 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultCapabilityMetadata.class) +}) +public interface CapabilityMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java index a06e883fc..66c980c48 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -17,33 +17,71 @@ import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + /** */ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultDescriptor.class), + @KnownSubtypes.Type(value = AssetAdministrationShellDescriptor.class), @KnownSubtypes.Type(value = SubmodelDescriptor.class) }) public interface Descriptor { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * More information under https://admin-shell.io/aas/3/0/Descriptor/description + * + * @return Returns the List of LangStringTextTypes for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/description + * + * @param descriptions desired value for the property description. + */ + void setDescription(List descriptions); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/displayName + * + * @return Returns the List of LangStringNameTypes for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/displayName + * + * @param displayNames desired value for the property displayName. + */ + void setDisplayName(List displayNames); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/extensions * - * @return Returns the List of Endpoints for the property endpoints. + * @return Returns the List of Extensions for the property extensions. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints") - List getEndpoints(); + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + List getExtensions(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Descriptor/endpoints + * More information under https://admin-shell.io/aas/3/0/Descriptor/extensions * - * @param endpoints desired value for the property endpoints. + * @param extensions desired value for the property extensions. */ - void setEndpoints(List endpoints); + void setExtensions(List extensions); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java index fa8b8fee6..35a90ca9a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * @@ -15,10 +15,16 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + +/** +*/ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultEndpoint.class) }) @@ -26,33 +32,33 @@ public interface Endpoint { /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * More information under https://admin-shell.io/aas/3/0/Endpoint/_interface * - * @return Returns the String for the property interface. + * @return Returns the String for the property _interface. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/interface") - String getInterface(); + @IRI("https://admin-shell.io/aas/3/0/Endpoint/_interface") + String get_interface(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/interface + * More information under https://admin-shell.io/aas/3/0/Endpoint/_interface * - * @param interfaceValue desired value for the property interface. + * @param _interface desired value for the property _interface. */ - void setInterface(String interfaceValue); + void set_interface(String _interface); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * More information under https://admin-shell.io/aas/3/0/Endpoint/protocolInformation * * @return Returns the ProtocolInformation for the property protocolInformation. */ - @IRI("https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation") + @IRI("https://admin-shell.io/aas/3/0/Endpoint/protocolInformation") ProtocolInformation getProtocolInformation(); /** * - * More information under https://admin-shell.io/aas/3/0/RC02/Endpoint/protocolInformation + * More information under https://admin-shell.io/aas/3/0/Endpoint/protocolInformation * * @param protocolInformation desired value for the property protocolInformation. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java new file mode 100644 index 000000000..bd64f2d0f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultEntityMetadata.class) +}) +public interface EntityMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java new file mode 100644 index 000000000..1b0b79f48 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultEntityValue.class) +}) +public interface EntityValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/entityType + * + * @return Returns the EntityType for the property entityType. + */ + @IRI("https://admin-shell.io/aas/3/0/EntityValue/entityType") + EntityType getEntityType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/entityType + * + * @param entityType desired value for the property entityType. + */ + void setEntityType(EntityType entityType); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/globalAssetId + * + * @return Returns the ReferenceValue for the property globalAssetId. + */ + @IRI("https://admin-shell.io/aas/3/0/EntityValue/globalAssetId") + ReferenceValue getGlobalAssetId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/globalAssetId + * + * @param globalAssetId desired value for the property globalAssetId. + */ + void setGlobalAssetId(ReferenceValue globalAssetId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds + * + * @return Returns the List of Strings for the property specificAssetIds. + */ + @IRI("https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds") + List getSpecificAssetIds(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds + * + * @param specificAssetIds desired value for the property specificAssetIds. + */ + void setSpecificAssetIds(List specificAssetIds); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/statements + * + * @return Returns the List of Strings for the property statements. + */ + @IRI("https://admin-shell.io/aas/3/0/EntityValue/statements") + List getStatements(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/EntityValue/statements + * + * @param statements desired value for the property statements. + */ + void setStatements(List statements); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java new file mode 100644 index 000000000..f3a6208a2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@IRI("aas:ExecutionState") +public enum ExecutionState { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Canceled") + CANCELED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Completed") + COMPLETED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Failed") + FAILED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Initiated") + INITIATED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Running") + RUNNING, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Timeout") + TIMEOUT; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java new file mode 100644 index 000000000..3847ea8e0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultFileMetadata.class) +}) +public interface FileMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java new file mode 100644 index 000000000..d8afd59bb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultFileValue.class) +}) +public interface FileValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/FileValue/contentType + * + * @return Returns the String for the property contentType. + */ + @IRI("https://admin-shell.io/aas/3/0/FileValue/contentType") + String getContentType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/FileValue/contentType + * + * @param contentType desired value for the property contentType. + */ + void setContentType(String contentType); + + /** + * + * More information under https://admin-shell.io/aas/3/0/FileValue/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/FileValue/value") + String getValue(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/FileValue/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java new file mode 100644 index 000000000..3c0210a9e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.io.Serializable; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +@IRI("rdf:langString") +public class LangString implements Serializable { + + private String language = null; + private String value = null; + + public LangString() { + super(); + } + + public LangString(String valueAndLanguage) { + if (valueAndLanguage.contains("@")) { + String[] splitString = valueAndLanguage.split("@"); + this.value = splitString[0]; + this.language = splitString[1]; + } else { + this.value = valueAndLanguage; + } + } + + public LangString(String value, String language) { + this.value = value; + this.language = language; + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + LangString other = (LangString) obj; + return Objects.equals(this.language, other.language) && Objects.equals(this.value, other.value); + } + } + + @Override + public int hashCode() { + return Objects.hash(this.language, this.value); + } + + @Override + public String toString() { + String result = this.value; + if (this.language != null && !this.language.isEmpty()) { + return "\"" + result + "\"@" + this.language; + } + return result; + } + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java new file mode 100644 index 000000000..300e7cf84 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultMessage.class) +}) +public interface Message { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/code + * + * @return Returns the String for the property code. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/code") + String getCode(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/code + * + * @param code desired value for the property code. + */ + void setCode(String code); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/messageType + * + * @return Returns the MessageType for the property messageType. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/messageType") + MessageType getMessageType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/messageType + * + * @param messageType desired value for the property messageType. + */ + void setMessageType(MessageType messageType); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/text + * + * @return Returns the String for the property text. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/text") + String getText(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/text + * + * @param text desired value for the property text. + */ + void setText(String text); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/timestamp + * + * @return Returns the String for the property timestamp. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/timestamp") + String getTimestamp(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/timestamp + * + * @param timestamp desired value for the property timestamp. + */ + void setTimestamp(String timestamp); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java new file mode 100644 index 000000000..056035fcd --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@IRI("aas:MessageType") +public enum MessageType { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Error") + ERROR, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Exception") + EXCEPTION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Info") + INFO, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Undefined") + UNDEFINED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Warning") + WARNING; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java new file mode 100644 index 000000000..c6fb480b3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultMultiLanguagePropertyMetadata.class) +}) +public interface MultiLanguagePropertyMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java new file mode 100644 index 000000000..055ddbfef --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultMultiLanguagePropertyValue.class) +}) +public interface MultiLanguagePropertyValue { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java new file mode 100644 index 000000000..d228e3deb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultNumberValue.class) +}) +public interface NumberValue { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java new file mode 100644 index 000000000..27518cff5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationHandle.class) +}) +public interface OperationHandle { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/handleId + * + * @return Returns the String for the property handleId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/handleId") + String getHandleId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/handleId + * + * @param handleId desired value for the property handleId. + */ + void setHandleId(String handleId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/requestId + * + * @return Returns the String for the property requestId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/requestId") + String getRequestId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/requestId + * + * @param requestId desired value for the property requestId. + */ + void setRequestId(String requestId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java new file mode 100644 index 000000000..de6132fcf --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationMetadata.class) +}) +public interface OperationMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java new file mode 100644 index 000000000..e3dadf435 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationRequest.class) +}) +public interface OperationRequest { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments + * + * @return Returns the OperationVariable for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") + OperationVariable getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(OperationVariable inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inputArguments + * + * @return Returns the OperationVariable for the property inputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") + OperationVariable getInputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inputArguments + * + * @param inputArguments desired value for the property inputArguments. + */ + void setInputArguments(OperationVariable inputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/requestId + * + * @return Returns the String for the property requestId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/requestId") + String getRequestId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/requestId + * + * @param requestId desired value for the property requestId. + */ + void setRequestId(String requestId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/timeout + * + * @return Returns the BigInteger for the property timeout. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/timeout") + BigInteger getTimeout(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/timeout + * + * @param timeout desired value for the property timeout. + */ + void setTimeout(BigInteger timeout); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java new file mode 100644 index 000000000..716877b3f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationRequestValueOnly.class) +}) +public interface OperationRequestValueOnly { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments + * + * @return Returns the String for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments") + String getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(String inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments + * + * @return Returns the String for the property inputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments") + String getInputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments + * + * @param inputArguments desired value for the property inputArguments. + */ + void setInputArguments(String inputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId + * + * @return Returns the String for the property requestId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId") + String getRequestId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId + * + * @param requestId desired value for the property requestId. + */ + void setRequestId(String requestId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout + * + * @return Returns the BigInteger for the property timeout. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout") + BigInteger getTimeout(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout + * + * @param timeout desired value for the property timeout. + */ + void setTimeout(BigInteger timeout); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java new file mode 100644 index 000000000..132522a70 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationResult.class) +}) +public interface OperationResult { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/executionResult + * + * @return Returns the Result for the property executionResult. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionResult") + Result getExecutionResult(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/executionResult + * + * @param executionResult desired value for the property executionResult. + */ + void setExecutionResult(Result executionResult); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/executionState + * + * @return Returns the ExecutionState for the property executionState. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionState") + ExecutionState getExecutionState(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/executionState + * + * @param executionState desired value for the property executionState. + */ + void setExecutionState(ExecutionState executionState); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments + * + * @return Returns the OperationVariable for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") + OperationVariable getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(OperationVariable inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/outputArguments + * + * @return Returns the OperationVariable for the property outputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") + OperationVariable getOutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/outputArguments + * + * @param outputArguments desired value for the property outputArguments. + */ + void setOutputArguments(OperationVariable outputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/requestId + * + * @return Returns the String for the property requestId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/requestId") + String getRequestId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/requestId + * + * @param requestId desired value for the property requestId. + */ + void setRequestId(String requestId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java new file mode 100644 index 000000000..e0f9d87a7 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationResultValueOnly.class) +}) +public interface OperationResultValueOnly { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult + * + * @return Returns the List of Results for the property executionResult. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult") + List getExecutionResult(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult + * + * @param executionResults desired value for the property executionResult. + */ + void setExecutionResult(List executionResults); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState + * + * @return Returns the List of ExecutionStates for the property executionState. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState") + List getExecutionState(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState + * + * @param executionStates desired value for the property executionState. + */ + void setExecutionState(List executionStates); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments + * + * @return Returns the List of Strings for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments") + List getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(List inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments + * + * @return Returns the List of Strings for the property outputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments") + List getOutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments + * + * @param outputArguments desired value for the property outputArguments. + */ + void setOutputArguments(List outputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId + * + * @return Returns the List of Strings for the property requestId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId") + List getRequestId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId + * + * @param requestIds desired value for the property requestId. + */ + void setRequestId(List requestIds); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java new file mode 100644 index 000000000..40d24e8cc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultPackageDescription.class) +}) +public interface PackageDescription { + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/items + * + * @return Returns the List of Strings for the property items. + */ + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/items") + List getItems(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/items + * + * @param items desired value for the property items. + */ + void setItems(List items); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/packageId + * + * @return Returns the String for the property packageId. + */ + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/packageId") + String getPackageId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/packageId + * + * @param packageId desired value for the property packageId. + */ + void setPackageId(String packageId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java new file mode 100644 index 000000000..7faf7300f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultPropertyMetadata.class) +}) +public interface PropertyMetadata extends SubmodelElementAttributes { + + /** + * + * More information under https://admin-shell.io/aas/3/0/PropertyMetadata/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/PropertyMetadata/valueType") + DataTypeDefXsd getValueType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PropertyMetadata/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java new file mode 100644 index 000000000..748fb4cde --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultRangeMetadata.class) +}) +public interface RangeMetadata extends SubmodelElementAttributes { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeMetadata/valueType + * + * @return Returns the DataTypeDefXsd for the property valueType. + */ + @IRI("https://admin-shell.io/aas/3/0/RangeMetadata/valueType") + DataTypeDefXsd getValueType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeMetadata/valueType + * + * @param valueType desired value for the property valueType. + */ + void setValueType(DataTypeDefXsd valueType); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java new file mode 100644 index 000000000..dc0b8f1c0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultRangeValue.class) +}) +public interface RangeValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeValue/max + * + * @return Returns the BigInteger for the property max. + */ + @IRI("https://admin-shell.io/aas/3/0/RangeValue/max") + BigInteger getMax(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeValue/max + * + * @param max desired value for the property max. + */ + void setMax(BigInteger max); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeValue/min + * + * @return Returns the BigInteger for the property min. + */ + @IRI("https://admin-shell.io/aas/3/0/RangeValue/min") + BigInteger getMin(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RangeValue/min + * + * @param min desired value for the property min. + */ + void setMin(BigInteger min); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java new file mode 100644 index 000000000..0ae63f8a9 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultReferenceElementMetadata.class) +}) +public interface ReferenceElementMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java new file mode 100644 index 000000000..20a03f4fc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultReferenceElementValue.class) +}) +public interface ReferenceElementValue extends ReferenceValue { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java new file mode 100644 index 000000000..439c072fc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultReferenceValue.class), + @KnownSubtypes.Type(value = ReferenceElementValue.class) +}) +public interface ReferenceValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments + * + * @return Returns the List of Keys for the property outputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") + List getOutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments + * + * @param outputArguments desired value for the property outputArguments. + */ + void setOutputArguments(List outputArguments); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java new file mode 100644 index 000000000..f25f0c56d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultRelationshipElementMetadata.class) +}) +public interface RelationshipElementMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java new file mode 100644 index 000000000..623499f0c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultRelationshipElementValue.class) +}) +public interface RelationshipElementValue { + + /** + * + * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/first + * + * @return Returns the ReferenceValue for the property first. + */ + @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/first") + ReferenceValue getFirst(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/first + * + * @param first desired value for the property first. + */ + void setFirst(ReferenceValue first); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/second + * + * @return Returns the ReferenceValue for the property second. + */ + @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/second") + ReferenceValue getSecond(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/second + * + * @param second desired value for the property second. + */ + void setSecond(ReferenceValue second); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java new file mode 100644 index 000000000..306347927 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultResult.class) +}) +public interface Result { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/messages + * + * @return Returns the List of Messages for the property messages. + */ + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + List getMessages(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/messages + * + * @param messages desired value for the property messages. + */ + void setMessages(List messages); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/success + * + * @return Returns the boolean for the property success. + */ + @IRI("https://admin-shell.io/aas/3/0/Result/success") + boolean getSuccess(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/success + * + * @param success desired value for the property success. + */ + void setSuccess(boolean success); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java new file mode 100644 index 000000000..842937b3b --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultStringValue.class) +}) +public interface StringValue { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java new file mode 100644 index 000000000..d2b6f99ce --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelElementAttributes.class), + @KnownSubtypes.Type(value = AnnotatedRelationshipElementMetadata.class), + @KnownSubtypes.Type(value = BasicEventElementMetadata.class), + @KnownSubtypes.Type(value = BlobMetadata.class), + @KnownSubtypes.Type(value = CapabilityMetadata.class), + @KnownSubtypes.Type(value = EntityMetadata.class), + @KnownSubtypes.Type(value = FileMetadata.class), + @KnownSubtypes.Type(value = MultiLanguagePropertyMetadata.class), + @KnownSubtypes.Type(value = OperationMetadata.class), + @KnownSubtypes.Type(value = PropertyMetadata.class), + @KnownSubtypes.Type(value = RangeMetadata.class), + @KnownSubtypes.Type(value = ReferenceElementMetadata.class), + @KnownSubtypes.Type(value = RelationshipElementMetadata.class), + @KnownSubtypes.Type(value = SubmodelElementListMetadata.class), + @KnownSubtypes.Type(value = SubmodelElementCollectionMetadata.class) +}) +public interface SubmodelElementAttributes extends HasDataSpecification, Referable, HasSemantics, Qualifiable { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind + * + * @return Returns the ModellingKind for the property kind. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + ModellingKind getKind(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind + * + * @param kind desired value for the property kind. + */ + void setKind(ModellingKind kind); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java new file mode 100644 index 000000000..47762424e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelElementCollectionMetadata.class) +}) +public interface SubmodelElementCollectionMetadata extends SubmodelElementAttributes { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java new file mode 100644 index 000000000..0c1bee9e4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelElementListMetadata.class) +}) +public interface SubmodelElementListMetadata extends SubmodelElementAttributes { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant + * + * @return Returns the boolean for the property orderRelevant. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant") + boolean getOrderRelevant(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant + * + * @param orderRelevant desired value for the property orderRelevant. + */ + void setOrderRelevant(boolean orderRelevant); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement + * + * @return Returns the Reference for the property semanticIdListElement. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement") + Reference getSemanticIdListElement(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement + * + * @param semanticIdListElement desired value for the property semanticIdListElement. + */ + void setSemanticIdListElement(Reference semanticIdListElement); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement + * + * @return Returns the ModelType for the property typeValueListElement. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement") + ModelType getTypeValueListElement(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement + * + * @param typeValueListElement desired value for the property typeValueListElement. + */ + void setTypeValueListElement(ModelType typeValueListElement); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement + * + * @return Returns the DataTypeDefXsd for the property valueTypeListElement. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement + * + * @param valueTypeListElement desired value for the property valueTypeListElement. + */ + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java new file mode 100644 index 000000000..2269efa0a --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelElementListValue.class) +}) +public interface SubmodelElementListValue { + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java new file mode 100644 index 000000000..7c9246d04 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelMetadata.class) +}) +public interface SubmodelMetadata extends Identifiable, HasDataSpecification, HasSemantics, Qualifiable { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelMetadata/kind + * + * @return Returns the ModellingKind for the property kind. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelMetadata/kind") + ModellingKind getKind(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelMetadata/kind + * + * @param kind desired value for the property kind. + */ + void setKind(ModellingKind kind); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java new file mode 100644 index 000000000..cae15bcb2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class AnnotatedRelationshipElementMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java new file mode 100644 index 000000000..5facc51d8 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class AnnotatedRelationshipElementValueBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for first + * + * @param first desired value to be set + * @return Builder object with new value for first + */ + public B first(ReferenceValue first) { + getBuildingInstance().setFirst(first); + return getSelf(); + } + + /** + * This function allows setting a value for second + * + * @param second desired value to be set + * @return Builder object with new value for second + */ + public B second(ReferenceValue second) { + getBuildingInstance().setSecond(second); + return getSelf(); + } + + /** + * This function allows setting a value for annotation + * + * @param annotations desired value to be set + * @return Builder object with new value for annotation + */ + public B annotation(List annotations) { + getBuildingInstance().setAnnotation(annotations); + return getSelf(); + } + + /** + * This function allows adding a value to the List annotation + * + * @param annotation desired value to be added + * @return Builder object with new value for annotation + */ + public B annotation(String annotation) { + getBuildingInstance().getAnnotation().add(annotation); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java new file mode 100644 index 000000000..6830021eb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class AssetAdministrationShellMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for derivedFrom + * + * @param derivedFroms desired value to be set + * @return Builder object with new value for derivedFrom + */ + public B derivedFrom(List derivedFroms) { + getBuildingInstance().setDerivedFrom(derivedFroms); + return getSelf(); + } + + /** + * This function allows adding a value to the List derivedFrom + * + * @param derivedFrom desired value to be added + * @return Builder object with new value for derivedFrom + */ + public B derivedFrom(Reference derivedFrom) { + getBuildingInstance().getDerivedFrom().add(derivedFrom); + return getSelf(); + } + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for id + * + * @param id desired value to be set + * @return Builder object with new value for id + */ + public B id(String id) { + getBuildingInstance().setId(id); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java new file mode 100644 index 000000000..1265fe728 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class BasicEventElementMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for direction + * + * @param directions desired value to be set + * @return Builder object with new value for direction + */ + public B direction(List directions) { + getBuildingInstance().setDirection(directions); + return getSelf(); + } + + /** + * This function allows adding a value to the List direction + * + * @param direction desired value to be added + * @return Builder object with new value for direction + */ + public B direction(Direction direction) { + getBuildingInstance().getDirection().add(direction); + return getSelf(); + } + + /** + * This function allows setting a value for state + * + * @param states desired value to be set + * @return Builder object with new value for state + */ + public B state(List states) { + getBuildingInstance().setState(states); + return getSelf(); + } + + /** + * This function allows adding a value to the List state + * + * @param state desired value to be added + * @return Builder object with new value for state + */ + public B state(StateOfEvent state) { + getBuildingInstance().getState().add(state); + return getSelf(); + } + + /** + * This function allows setting a value for messageBroker + * + * @param messageBrokers desired value to be set + * @return Builder object with new value for messageBroker + */ + public B messageBroker(List messageBrokers) { + getBuildingInstance().setMessageBroker(messageBrokers); + return getSelf(); + } + + /** + * This function allows adding a value to the List messageBroker + * + * @param messageBroker desired value to be added + * @return Builder object with new value for messageBroker + */ + public B messageBroker(Reference messageBroker) { + getBuildingInstance().getMessageBroker().add(messageBroker); + return getSelf(); + } + + /** + * This function allows setting a value for messageTopic + * + * @param messageTopics desired value to be set + * @return Builder object with new value for messageTopic + */ + public B messageTopic(List messageTopics) { + getBuildingInstance().setMessageTopic(messageTopics); + return getSelf(); + } + + /** + * This function allows adding a value to the List messageTopic + * + * @param messageTopic desired value to be added + * @return Builder object with new value for messageTopic + */ + public B messageTopic(String messageTopic) { + getBuildingInstance().getMessageTopic().add(messageTopic); + return getSelf(); + } + + /** + * This function allows setting a value for lastUpdate + * + * @param lastUpdates desired value to be set + * @return Builder object with new value for lastUpdate + */ + public B lastUpdate(List lastUpdates) { + getBuildingInstance().setLastUpdate(lastUpdates); + return getSelf(); + } + + /** + * This function allows adding a value to the List lastUpdate + * + * @param lastUpdate desired value to be added + * @return Builder object with new value for lastUpdate + */ + public B lastUpdate(String lastUpdate) { + getBuildingInstance().getLastUpdate().add(lastUpdate); + return getSelf(); + } + + /** + * This function allows setting a value for minInterval + * + * @param minIntervals desired value to be set + * @return Builder object with new value for minInterval + */ + public B minInterval(List minIntervals) { + getBuildingInstance().setMinInterval(minIntervals); + return getSelf(); + } + + /** + * This function allows adding a value to the List minInterval + * + * @param minInterval desired value to be added + * @return Builder object with new value for minInterval + */ + public B minInterval(String minInterval) { + getBuildingInstance().getMinInterval().add(minInterval); + return getSelf(); + } + + /** + * This function allows setting a value for maxInterval + * + * @param maxIntervals desired value to be set + * @return Builder object with new value for maxInterval + */ + public B maxInterval(List maxIntervals) { + getBuildingInstance().setMaxInterval(maxIntervals); + return getSelf(); + } + + /** + * This function allows adding a value to the List maxInterval + * + * @param maxInterval desired value to be added + * @return Builder object with new value for maxInterval + */ + public B maxInterval(String maxInterval) { + getBuildingInstance().getMaxInterval().add(maxInterval); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java new file mode 100644 index 000000000..38b0bc07b --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class BasicEventElementValueBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for observed + * + * @param observeds desired value to be set + * @return Builder object with new value for observed + */ + public B observed(List observeds) { + getBuildingInstance().setObserved(observeds); + return getSelf(); + } + + /** + * This function allows adding a value to the List observed + * + * @param observed desired value to be added + * @return Builder object with new value for observed + */ + public B observed(ReferenceValue observed) { + getBuildingInstance().getObserved().add(observed); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java new file mode 100644 index 000000000..1299a06af --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class BlobMetadataBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java new file mode 100644 index 000000000..96dbcd667 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class BlobValueBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for mimeType + * + * @param mimeType desired value to be set + * @return Builder object with new value for mimeType + */ + public B mimeType(String mimeType) { + getBuildingInstance().setMimeType(mimeType); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java new file mode 100644 index 000000000..6c4f7b48a --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class CapabilityMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java deleted file mode 100644 index 1cebc09f8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DataSpecificationPhysicalUnitBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - - -public abstract class DataSpecificationPhysicalUnitBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for conversionFactor - * - * @param conversionFactor desired conversionFactor to be set - * @return Builder object with new value for conversionFactor - */ - public B conversionFactor(String conversionFactor) { - getBuildingInstance().setConversionFactor(conversionFactor); - return getSelf(); - } - - public B dinNotation(String dinNotation) { - getBuildingInstance().setDinNotation(dinNotation); - return getSelf(); - } - - public B eceCode(String eceCode) { - getBuildingInstance().setEceCode(eceCode); - return getSelf(); - } - - public B eceName(String eceName) { - getBuildingInstance().setEceName(eceName); - return getSelf(); - } - - public B nistName(String nistName) { - getBuildingInstance().setNistName(nistName); - return getSelf(); - } - - public B registrationAuthorityId(String registrationAuthorityId) { - getBuildingInstance().setRegistrationAuthorityId(registrationAuthorityId); - return getSelf(); - } - - public B siName(String siName) { - getBuildingInstance().setSiName(siName); - return getSelf(); - } - - public B siNotation(String siNotation) { - getBuildingInstance().setSiNotation(siNotation); - return getSelf(); - } - - public B sourceOfDefinition(String sourceOfDefinition) { - getBuildingInstance().setSourceOfDefinition(sourceOfDefinition); - return getSelf(); - } - - public B supplier(String supplier) { - getBuildingInstance().setSupplier(supplier); - return getSelf(); - } - - public B unitName(String unitName) { - getBuildingInstance().setUnitName(unitName); - return getSelf(); - } - - public B unitSymbol(String unitSymbol) { - getBuildingInstance().setUnitSymbol(unitSymbol); - return getSelf(); - } - - public B definition(LangStringTextType definition) { - List definitionList = getBuildingInstance().getDefinition(); - if (definitionList == null) { - definitionList = new ArrayList<>(); - getBuildingInstance().setDefinition(definitionList); - } - definitionList.add(definition); - return getSelf(); - } - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java new file mode 100644 index 000000000..04d897fcd --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class EntityMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java new file mode 100644 index 000000000..98d930124 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class EntityValueBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for entityType + * + * @param entityType desired value to be set + * @return Builder object with new value for entityType + */ + public B entityType(EntityType entityType) { + getBuildingInstance().setEntityType(entityType); + return getSelf(); + } + + /** + * This function allows setting a value for globalAssetId + * + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId + */ + public B globalAssetId(ReferenceValue globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for specificAssetIds + * + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds + */ + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List specificAssetIds + * + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds + */ + public B specificAssetIds(String specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + return getSelf(); + } + + /** + * This function allows setting a value for statements + * + * @param statements desired value to be set + * @return Builder object with new value for statements + */ + public B statements(List statements) { + getBuildingInstance().setStatements(statements); + return getSelf(); + } + + /** + * This function allows adding a value to the List statements + * + * @param statements desired value to be added + * @return Builder object with new value for statements + */ + public B statements(String statements) { + getBuildingInstance().getStatements().add(statements); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java new file mode 100644 index 000000000..0646384b0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class FileMetadataBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java new file mode 100644 index 000000000..804f47734 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class FileValueBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for contentType + * + * @param contentType desired value to be set + * @return Builder object with new value for contentType + */ + public B contentType(String contentType) { + getBuildingInstance().setContentType(contentType); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java new file mode 100644 index 000000000..e81d13651 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class MessageBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for code + * + * @param code desired value to be set + * @return Builder object with new value for code + */ + public B code(String code) { + getBuildingInstance().setCode(code); + return getSelf(); + } + + /** + * This function allows setting a value for messageType + * + * @param messageType desired value to be set + * @return Builder object with new value for messageType + */ + public B messageType(MessageType messageType) { + getBuildingInstance().setMessageType(messageType); + return getSelf(); + } + + /** + * This function allows setting a value for text + * + * @param text desired value to be set + * @return Builder object with new value for text + */ + public B text(String text) { + getBuildingInstance().setText(text); + return getSelf(); + } + + /** + * This function allows setting a value for timestamp + * + * @param timestamp desired value to be set + * @return Builder object with new value for timestamp + */ + public B timestamp(String timestamp) { + getBuildingInstance().setTimestamp(timestamp); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java new file mode 100644 index 000000000..c76450090 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class MultiLanguagePropertyMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java new file mode 100644 index 000000000..45ef870bb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class MultiLanguagePropertyValueBuilder> + extends ExtendableBuilder { +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java new file mode 100644 index 000000000..0bf588699 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class NumberValueBuilder> extends ExtendableBuilder { +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java new file mode 100644 index 000000000..694240089 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationHandleBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for handleId + * + * @param handleId desired value to be set + * @return Builder object with new value for handleId + */ + public B handleId(String handleId) { + getBuildingInstance().setHandleId(handleId); + return getSelf(); + } + + /** + * This function allows setting a value for requestId + * + * @param requestId desired value to be set + * @return Builder object with new value for requestId + */ + public B requestId(String requestId) { + getBuildingInstance().setRequestId(requestId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java new file mode 100644 index 000000000..0d60e7a03 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java new file mode 100644 index 000000000..ea03d1ac9 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationRequestBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(OperationVariable inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for inputArguments + * + * @param inputArguments desired value to be set + * @return Builder object with new value for inputArguments + */ + public B inputArguments(OperationVariable inputArguments) { + getBuildingInstance().setInputArguments(inputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for requestId + * + * @param requestId desired value to be set + * @return Builder object with new value for requestId + */ + public B requestId(String requestId) { + getBuildingInstance().setRequestId(requestId); + return getSelf(); + } + + /** + * This function allows setting a value for timeout + * + * @param timeout desired value to be set + * @return Builder object with new value for timeout + */ + public B timeout(BigInteger timeout) { + getBuildingInstance().setTimeout(timeout); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java new file mode 100644 index 000000000..88d173741 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationRequestValueOnlyBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(String inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for inputArguments + * + * @param inputArguments desired value to be set + * @return Builder object with new value for inputArguments + */ + public B inputArguments(String inputArguments) { + getBuildingInstance().setInputArguments(inputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for requestId + * + * @param requestId desired value to be set + * @return Builder object with new value for requestId + */ + public B requestId(String requestId) { + getBuildingInstance().setRequestId(requestId); + return getSelf(); + } + + /** + * This function allows setting a value for timeout + * + * @param timeout desired value to be set + * @return Builder object with new value for timeout + */ + public B timeout(BigInteger timeout) { + getBuildingInstance().setTimeout(timeout); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java new file mode 100644 index 000000000..02cba6e4c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationResultBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for executionResult + * + * @param executionResult desired value to be set + * @return Builder object with new value for executionResult + */ + public B executionResult(Result executionResult) { + getBuildingInstance().setExecutionResult(executionResult); + return getSelf(); + } + + /** + * This function allows setting a value for executionState + * + * @param executionState desired value to be set + * @return Builder object with new value for executionState + */ + public B executionState(ExecutionState executionState) { + getBuildingInstance().setExecutionState(executionState); + return getSelf(); + } + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(OperationVariable inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for outputArguments + * + * @param outputArguments desired value to be set + * @return Builder object with new value for outputArguments + */ + public B outputArguments(OperationVariable outputArguments) { + getBuildingInstance().setOutputArguments(outputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for requestId + * + * @param requestId desired value to be set + * @return Builder object with new value for requestId + */ + public B requestId(String requestId) { + getBuildingInstance().setRequestId(requestId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java new file mode 100644 index 000000000..de25954ac --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class OperationResultValueOnlyBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for executionResult + * + * @param executionResults desired value to be set + * @return Builder object with new value for executionResult + */ + public B executionResult(List executionResults) { + getBuildingInstance().setExecutionResult(executionResults); + return getSelf(); + } + + /** + * This function allows adding a value to the List executionResult + * + * @param executionResult desired value to be added + * @return Builder object with new value for executionResult + */ + public B executionResult(Result executionResult) { + getBuildingInstance().getExecutionResult().add(executionResult); + return getSelf(); + } + + /** + * This function allows setting a value for executionState + * + * @param executionStates desired value to be set + * @return Builder object with new value for executionState + */ + public B executionState(List executionStates) { + getBuildingInstance().setExecutionState(executionStates); + return getSelf(); + } + + /** + * This function allows adding a value to the List executionState + * + * @param executionState desired value to be added + * @return Builder object with new value for executionState + */ + public B executionState(ExecutionState executionState) { + getBuildingInstance().getExecutionState().add(executionState); + return getSelf(); + } + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(List inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputArguments + * + * @param inoutputArguments desired value to be added + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(String inoutputArguments) { + getBuildingInstance().getInoutputArguments().add(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for outputArguments + * + * @param outputArguments desired value to be set + * @return Builder object with new value for outputArguments + */ + public B outputArguments(List outputArguments) { + getBuildingInstance().setOutputArguments(outputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List outputArguments + * + * @param outputArguments desired value to be added + * @return Builder object with new value for outputArguments + */ + public B outputArguments(String outputArguments) { + getBuildingInstance().getOutputArguments().add(outputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for requestId + * + * @param requestIds desired value to be set + * @return Builder object with new value for requestId + */ + public B requestId(List requestIds) { + getBuildingInstance().setRequestId(requestIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List requestId + * + * @param requestId desired value to be added + * @return Builder object with new value for requestId + */ + public B requestId(String requestId) { + getBuildingInstance().getRequestId().add(requestId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java new file mode 100644 index 000000000..d9fbb3afb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class PackageDescriptionBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for items + * + * @param items desired value to be set + * @return Builder object with new value for items + */ + public B items(List items) { + getBuildingInstance().setItems(items); + return getSelf(); + } + + /** + * This function allows adding a value to the List items + * + * @param items desired value to be added + * @return Builder object with new value for items + */ + public B items(String items) { + getBuildingInstance().getItems().add(items); + return getSelf(); + } + + /** + * This function allows setting a value for packageId + * + * @param packageId desired value to be set + * @return Builder object with new value for packageId + */ + public B packageId(String packageId) { + getBuildingInstance().setPackageId(packageId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java new file mode 100644 index 000000000..4558f267f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class PropertyMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java new file mode 100644 index 000000000..4ae38c2af --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class RangeMetadataBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for valueType + * + * @param valueType desired value to be set + * @return Builder object with new value for valueType + */ + public B valueType(DataTypeDefXsd valueType) { + getBuildingInstance().setValueType(valueType); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java new file mode 100644 index 000000000..6563cf167 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.math.BigInteger; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class RangeValueBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for max + * + * @param max desired value to be set + * @return Builder object with new value for max + */ + public B max(BigInteger max) { + getBuildingInstance().setMax(max); + return getSelf(); + } + + /** + * This function allows setting a value for min + * + * @param min desired value to be set + * @return Builder object with new value for min + */ + public B min(BigInteger min) { + getBuildingInstance().setMin(min); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java new file mode 100644 index 000000000..3a479dfc7 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class ReferenceElementMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java new file mode 100644 index 000000000..95baf96d3 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class ReferenceElementValueBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for outputArguments + * + * @param outputArguments desired value to be set + * @return Builder object with new value for outputArguments + */ + public B outputArguments(List outputArguments) { + getBuildingInstance().setOutputArguments(outputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List outputArguments + * + * @param outputArguments desired value to be added + * @return Builder object with new value for outputArguments + */ + public B outputArguments(Key outputArguments) { + getBuildingInstance().getOutputArguments().add(outputArguments); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java new file mode 100644 index 000000000..83f240f86 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class ReferenceValueBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for outputArguments + * + * @param outputArguments desired value to be set + * @return Builder object with new value for outputArguments + */ + public B outputArguments(List outputArguments) { + getBuildingInstance().setOutputArguments(outputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List outputArguments + * + * @param outputArguments desired value to be added + * @return Builder object with new value for outputArguments + */ + public B outputArguments(Key outputArguments) { + getBuildingInstance().getOutputArguments().add(outputArguments); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java new file mode 100644 index 000000000..0e72abffb --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class RelationshipElementMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java new file mode 100644 index 000000000..ae3f82297 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class RelationshipElementValueBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for first + * + * @param first desired value to be set + * @return Builder object with new value for first + */ + public B first(ReferenceValue first) { + getBuildingInstance().setFirst(first); + return getSelf(); + } + + /** + * This function allows setting a value for second + * + * @param second desired value to be set + * @return Builder object with new value for second + */ + public B second(ReferenceValue second) { + getBuildingInstance().setSecond(second); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java new file mode 100644 index 000000000..fe33a5a75 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class ResultBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for messages + * + * @param messages desired value to be set + * @return Builder object with new value for messages + */ + public B messages(List messages) { + getBuildingInstance().setMessages(messages); + return getSelf(); + } + + /** + * This function allows adding a value to the List messages + * + * @param messages desired value to be added + * @return Builder object with new value for messages + */ + public B messages(Message messages) { + getBuildingInstance().getMessages().add(messages); + return getSelf(); + } + + /** + * This function allows setting a value for success + * + * @param success desired value to be set + * @return Builder object with new value for success + */ + public B success(boolean success) { + getBuildingInstance().setSuccess(success); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java new file mode 100644 index 000000000..349929422 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class StringValueBuilder> extends ExtendableBuilder { +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java new file mode 100644 index 000000000..9e15c34d6 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SubmodelElementAttributesBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java new file mode 100644 index 000000000..57c3c363e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SubmodelElementCollectionMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java new file mode 100644 index 000000000..90f89019e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SubmodelElementListMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for orderRelevant + * + * @param orderRelevant desired value to be set + * @return Builder object with new value for orderRelevant + */ + public B orderRelevant(boolean orderRelevant) { + getBuildingInstance().setOrderRelevant(orderRelevant); + return getSelf(); + } + + /** + * This function allows setting a value for semanticIdListElement + * + * @param semanticIdListElement desired value to be set + * @return Builder object with new value for semanticIdListElement + */ + public B semanticIdListElement(Reference semanticIdListElement) { + getBuildingInstance().setSemanticIdListElement(semanticIdListElement); + return getSelf(); + } + + /** + * This function allows setting a value for typeValueListElement + * + * @param typeValueListElement desired value to be set + * @return Builder object with new value for typeValueListElement + */ + public B typeValueListElement(ModelType typeValueListElement) { + getBuildingInstance().setTypeValueListElement(typeValueListElement); + return getSelf(); + } + + /** + * This function allows setting a value for valueTypeListElement + * + * @param valueTypeListElement desired value to be set + * @return Builder object with new value for valueTypeListElement + */ + public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { + getBuildingInstance().setValueTypeListElement(valueTypeListElement); + return getSelf(); + } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java new file mode 100644 index 000000000..16a2bdd47 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SubmodelElementListValueBuilder> + extends ExtendableBuilder { +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java new file mode 100644 index 000000000..cb5f552e2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import java.util.List; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SubmodelMetadataBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for id + * + * @param id desired value to be set + * @return Builder object with new value for id + */ + public B id(String id) { + getBuildingInstance().setId(id); + return getSelf(); + } + + /** + * This function allows setting a value for category + * + * @param category desired value to be set + * @return Builder object with new value for category + */ + public B category(String category) { + getBuildingInstance().setCategory(category); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java new file mode 100644 index 000000000..ae1f7192f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementMetadata + * + */ + +@IRI("aas:AnnotatedRelationshipElementMetadata") +public class DefaultAnnotatedRelationshipElementMetadata implements AnnotatedRelationshipElementMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultAnnotatedRelationshipElementMetadata() {} + + public DefaultAnnotatedRelationshipElementMetadata(AnnotatedRelationshipElementMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAnnotatedRelationshipElementMetadata other = (DefaultAnnotatedRelationshipElementMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElementMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultAnnotatedRelationshipElementMetadata bean. + */ + public static class Builder extends AnnotatedRelationshipElementMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAnnotatedRelationshipElementMetadata newBuildingInstance() { + return new DefaultAnnotatedRelationshipElementMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java new file mode 100644 index 000000000..964dcc426 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementValue + * + */ + +@IRI("aas:AnnotatedRelationshipElementValue") +public class DefaultAnnotatedRelationshipElementValue implements AnnotatedRelationshipElementValue { + + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation") + protected List annotation = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first") + protected ReferenceValue first; + + @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second") + protected ReferenceValue second; + + public DefaultAnnotatedRelationshipElementValue() {} + + public DefaultAnnotatedRelationshipElementValue(AnnotatedRelationshipElementValue x) { + this.annotation = x.getAnnotation(); + this.first = x.getFirst(); + this.second = x.getSecond(); + } + + @Override + public int hashCode() { + return Objects.hash(this.first, + this.second, + this.annotation); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAnnotatedRelationshipElementValue other = (DefaultAnnotatedRelationshipElementValue) obj; + return Objects.equals(this.first, other.first) && + Objects.equals(this.second, other.second) && + Objects.equals(this.annotation, other.annotation); + } + } + + @Override + public ReferenceValue getFirst() { + return first; + } + + @Override + public void setFirst(ReferenceValue first) { + this.first = first; + } + + @Override + public ReferenceValue getSecond() { + return second; + } + + @Override + public void setSecond(ReferenceValue second) { + this.second = second; + } + + @Override + public List getAnnotation() { + return annotation; + } + + @Override + public void setAnnotation(List annotations) { + this.annotation = annotations; + } + + public String toString() { + return String.format( + "DefaultAnnotatedRelationshipElementValue (" + "first=%s," + + "second=%s," + + "annotation=%s," + + ")", + this.first, this.second, this.annotation); + } + + /** + * This builder class can be used to construct a DefaultAnnotatedRelationshipElementValue bean. + */ + public static class Builder extends AnnotatedRelationshipElementValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAnnotatedRelationshipElementValue newBuildingInstance() { + return new DefaultAnnotatedRelationshipElementValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java new file mode 100644 index 000000000..df48cd549 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellMetadata + * + */ + +@IRI("aas:AssetAdministrationShellMetadata") +public class DefaultAssetAdministrationShellMetadata implements AssetAdministrationShellMetadata { + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom") + protected List derivedFrom = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + protected String id; + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + public DefaultAssetAdministrationShellMetadata() {} + + public DefaultAssetAdministrationShellMetadata(AssetAdministrationShellMetadata x) { + this.derivedFrom = x.getDerivedFrom(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.administration = x.getAdministration(); + this.id = x.getId(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + } + + @Override + public int hashCode() { + return Objects.hash(this.derivedFrom, + this.administration, + this.id, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.embeddedDataSpecifications); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAssetAdministrationShellMetadata other = (DefaultAssetAdministrationShellMetadata) obj; + return Objects.equals(this.derivedFrom, other.derivedFrom) && + Objects.equals(this.administration, other.administration) && + Objects.equals(this.id, other.id) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); + } + } + + @Override + public List getDerivedFrom() { + return derivedFrom; + } + + @Override + public void setDerivedFrom(List derivedFroms) { + this.derivedFrom = derivedFroms; + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + public String toString() { + return String.format( + "DefaultAssetAdministrationShellMetadata (" + "derivedFrom=%s," + + ")", + this.derivedFrom); + } + + /** + * This builder class can be used to construct a DefaultAssetAdministrationShellMetadata bean. + */ + public static class Builder extends AssetAdministrationShellMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAssetAdministrationShellMetadata newBuildingInstance() { + return new DefaultAssetAdministrationShellMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java new file mode 100644 index 000000000..650554123 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementMetadata + * + */ + +@IRI("aas:BasicEventElementMetadata") +public class DefaultBasicEventElementMetadata implements BasicEventElementMetadata { + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction") + protected List direction = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate") + protected List lastUpdate = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval") + protected List maxInterval = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker") + protected List messageBroker = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic") + protected List messageTopic = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval") + protected List minInterval = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state") + protected List state = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultBasicEventElementMetadata() {} + + public DefaultBasicEventElementMetadata(BasicEventElementMetadata x) { + this.direction = x.getDirection(); + this.lastUpdate = x.getLastUpdate(); + this.maxInterval = x.getMaxInterval(); + this.messageBroker = x.getMessageBroker(); + this.messageTopic = x.getMessageTopic(); + this.minInterval = x.getMinInterval(); + this.state = x.getState(); + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.direction, + this.state, + this.messageBroker, + this.messageTopic, + this.lastUpdate, + this.minInterval, + this.maxInterval, + this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBasicEventElementMetadata other = (DefaultBasicEventElementMetadata) obj; + return Objects.equals(this.direction, other.direction) && + Objects.equals(this.state, other.state) && + Objects.equals(this.messageBroker, other.messageBroker) && + Objects.equals(this.messageTopic, other.messageTopic) && + Objects.equals(this.lastUpdate, other.lastUpdate) && + Objects.equals(this.minInterval, other.minInterval) && + Objects.equals(this.maxInterval, other.maxInterval) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public List getDirection() { + return direction; + } + + @Override + public void setDirection(List directions) { + this.direction = directions; + } + + @Override + public List getState() { + return state; + } + + @Override + public void setState(List states) { + this.state = states; + } + + @Override + public List getMessageBroker() { + return messageBroker; + } + + @Override + public void setMessageBroker(List messageBrokers) { + this.messageBroker = messageBrokers; + } + + @Override + public List getMessageTopic() { + return messageTopic; + } + + @Override + public void setMessageTopic(List messageTopics) { + this.messageTopic = messageTopics; + } + + @Override + public List getLastUpdate() { + return lastUpdate; + } + + @Override + public void setLastUpdate(List lastUpdates) { + this.lastUpdate = lastUpdates; + } + + @Override + public List getMinInterval() { + return minInterval; + } + + @Override + public void setMinInterval(List minIntervals) { + this.minInterval = minIntervals; + } + + @Override + public List getMaxInterval() { + return maxInterval; + } + + @Override + public void setMaxInterval(List maxIntervals) { + this.maxInterval = maxIntervals; + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultBasicEventElementMetadata (" + "direction=%s," + + "state=%s," + + "messageBroker=%s," + + "messageTopic=%s," + + "lastUpdate=%s," + + "minInterval=%s," + + "maxInterval=%s," + + ")", + this.direction, this.state, this.messageBroker, this.messageTopic, this.lastUpdate, this.minInterval, this.maxInterval); + } + + /** + * This builder class can be used to construct a DefaultBasicEventElementMetadata bean. + */ + public static class Builder extends BasicEventElementMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBasicEventElementMetadata newBuildingInstance() { + return new DefaultBasicEventElementMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java new file mode 100644 index 000000000..f513c62e5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementValue + * + */ + +@IRI("aas:BasicEventElementValue") +public class DefaultBasicEventElementValue implements BasicEventElementValue { + + @IRI("https://admin-shell.io/aas/3/0/BasicEventElementValue/observed") + protected List observed = new ArrayList<>(); + + public DefaultBasicEventElementValue() {} + + public DefaultBasicEventElementValue(BasicEventElementValue x) { + this.observed = x.getObserved(); + } + + @Override + public int hashCode() { + return Objects.hash(this.observed); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBasicEventElementValue other = (DefaultBasicEventElementValue) obj; + return Objects.equals(this.observed, other.observed); + } + } + + @Override + public List getObserved() { + return observed; + } + + @Override + public void setObserved(List observeds) { + this.observed = observeds; + } + + public String toString() { + return String.format( + "DefaultBasicEventElementValue (" + "observed=%s," + + ")", + this.observed); + } + + /** + * This builder class can be used to construct a DefaultBasicEventElementValue bean. + */ + public static class Builder extends BasicEventElementValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBasicEventElementValue newBuildingInstance() { + return new DefaultBasicEventElementValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java new file mode 100644 index 000000000..294be7279 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BlobMetadata + * + */ + +@IRI("aas:BlobMetadata") +public class DefaultBlobMetadata implements BlobMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultBlobMetadata() {} + + public DefaultBlobMetadata(BlobMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBlobMetadata other = (DefaultBlobMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultBlobMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultBlobMetadata bean. + */ + public static class Builder extends BlobMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBlobMetadata newBuildingInstance() { + return new DefaultBlobMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java new file mode 100644 index 000000000..3d220c308 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BlobValue + * + */ + +@IRI("aas:BlobValue") +public class DefaultBlobValue implements BlobValue { + + @IRI("https://admin-shell.io/aas/3/0/BlobValue/mimeType") + protected String mimeType; + + @IRI("https://admin-shell.io/aas/3/0/BlobValue/value") + protected String value; + + public DefaultBlobValue() {} + + public DefaultBlobValue(BlobValue x) { + this.mimeType = x.getMimeType(); + this.value = x.getValue(); + } + + @Override + public int hashCode() { + return Objects.hash(this.mimeType, + this.value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBlobValue other = (DefaultBlobValue) obj; + return Objects.equals(this.mimeType, other.mimeType) && + Objects.equals(this.value, other.value); + } + } + + @Override + public String getMimeType() { + return mimeType; + } + + @Override + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + public String toString() { + return String.format( + "DefaultBlobValue (" + "mimeType=%s," + + "value=%s," + + ")", + this.mimeType, this.value); + } + + /** + * This builder class can be used to construct a DefaultBlobValue bean. + */ + public static class Builder extends BlobValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBlobValue newBuildingInstance() { + return new DefaultBlobValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java new file mode 100644 index 000000000..dfe77fb95 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.CapabilityMetadata + * + */ + +@IRI("aas:CapabilityMetadata") +public class DefaultCapabilityMetadata implements CapabilityMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultCapabilityMetadata() {} + + public DefaultCapabilityMetadata(CapabilityMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultCapabilityMetadata other = (DefaultCapabilityMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultCapabilityMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultCapabilityMetadata bean. + */ + public static class Builder extends CapabilityMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultCapabilityMetadata newBuildingInstance() { + return new DefaultCapabilityMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java deleted file mode 100644 index b24b826eb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationPhysicalUnit.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import java.util.List; -import java.util.Objects; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationPhysicalUnitBuilder; - - -/** - * Default implementation of org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationPhysicalUnit - */ - -@IRI("aas:DefaultDataSpecificationPhysicalUnit") -public class DefaultDataSpecificationPhysicalUnit implements DataSpecificationPhysicalUnit { - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/conversionFactor") - protected String conversionFactor; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/dinNotation") - protected String dinNotation; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceCode") - protected String eceCode; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/eceName") - protected String eceName; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/nistName") - protected String nistName; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/registrationAuthorityId") - protected String registrationAuthorityId; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siName") - protected String siName; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/siNotation") - protected String siNotation; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/sourceOfDefinition") - protected String sourceOfDefinition; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/supplier") - protected String supplier; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitName") - protected String unitName; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/unitSymbol") - protected String unitSymbol; - @IRI("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02/definition") - protected List definition; - - public DefaultDataSpecificationPhysicalUnit() { - } - - @Override - public int hashCode() { - return Objects.hash(this.conversionFactor); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultDataSpecificationPhysicalUnit other = (DefaultDataSpecificationPhysicalUnit) obj; - return Objects.equals(this.conversionFactor, other.conversionFactor); - } - } - - @Override - public String getConversionFactor() { - return conversionFactor; - } - - @Override - public void setConversionFactor(String conversionFactor) { - this.conversionFactor = conversionFactor; - } - - @Override - public String getDinNotation() { - return dinNotation; - } - - @Override - public void setDinNotation(String dinNotation) { - this.dinNotation = dinNotation; - } - - @Override - public String getEceCode() { - return eceCode; - } - - @Override - public void setEceCode(String eceCode) { - this.eceCode = eceCode; - } - - @Override - public String getEceName() { - return eceName; - } - - @Override - public void setEceName(String eceName) { - this.eceName = eceName; - } - - @Override - public String getNistName() { - return nistName; - } - - @Override - public void setNistName(String nistName) { - this.nistName = nistName; - } - - @Override - public String getRegistrationAuthorityId() { - return registrationAuthorityId; - } - - @Override - public void setRegistrationAuthorityId(String registrationAuthorityId) { - this.registrationAuthorityId = registrationAuthorityId; - } - - @Override - public String getSiName() { - return siName; - } - - @Override - public void setSiName(String siName) { - this.siName = siName; - } - - @Override - public String getSiNotation() { - return siNotation; - } - - @Override - public void setSiNotation(String siNotation) { - this.siNotation = siNotation; - } - - @Override - public String getSourceOfDefinition() { - return sourceOfDefinition; - } - - @Override - public void setSourceOfDefinition(String sourceOfDefinition) { - this.sourceOfDefinition = sourceOfDefinition; - } - - @Override - public String getSupplier() { - return supplier; - } - - @Override - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - @Override - public String getUnitName() { - return unitName; - } - - @Override - public void setUnitName(String unitName) { - this.unitName = unitName; - } - - @Override - public String getUnitSymbol() { - return unitSymbol; - } - - @Override - public void setUnitSymbol(String unitSymbol) { - this.unitSymbol = unitSymbol; - } - - @Override - public List getDefinition() { - return definition; - } - - @Override - public void setDefinition(List definition) { - this.definition = definition; - } - - public String toString() { - return String.format( - "DefaultDataSpecificationPhysicalUnit (conversionFactor=%s)", - this.conversionFactor); - } - - /** - * This builder class can be used to construct a DefaultDataSpecificationPhysicalUnit bean. - */ - public static class Builder extends DataSpecificationPhysicalUnitBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultDataSpecificationPhysicalUnit newBuildingInstance() { - return new DefaultDataSpecificationPhysicalUnit(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java new file mode 100644 index 000000000..cc3ee660e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.EntityMetadata + * + */ + +@IRI("aas:EntityMetadata") +public class DefaultEntityMetadata implements EntityMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultEntityMetadata() {} + + public DefaultEntityMetadata(EntityMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultEntityMetadata other = (DefaultEntityMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultEntityMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultEntityMetadata bean. + */ + public static class Builder extends EntityMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultEntityMetadata newBuildingInstance() { + return new DefaultEntityMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java new file mode 100644 index 000000000..18b1e7539 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.EntityValue + * + */ + +@IRI("aas:EntityValue") +public class DefaultEntityValue implements EntityValue { + + @IRI("https://admin-shell.io/aas/3/0/EntityValue/entityType") + protected EntityType entityType; + + @IRI("https://admin-shell.io/aas/3/0/EntityValue/globalAssetId") + protected ReferenceValue globalAssetId; + + @IRI("https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds") + protected List specificAssetIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/EntityValue/statements") + protected List statements = new ArrayList<>(); + + public DefaultEntityValue() {} + + public DefaultEntityValue(EntityValue x) { + this.entityType = x.getEntityType(); + this.globalAssetId = x.getGlobalAssetId(); + this.specificAssetIds = x.getSpecificAssetIds(); + this.statements = x.getStatements(); + } + + @Override + public int hashCode() { + return Objects.hash(this.entityType, + this.globalAssetId, + this.specificAssetIds, + this.statements); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultEntityValue other = (DefaultEntityValue) obj; + return Objects.equals(this.entityType, other.entityType) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.statements, other.statements); + } + } + + @Override + public EntityType getEntityType() { + return entityType; + } + + @Override + public void setEntityType(EntityType entityType) { + this.entityType = entityType; + } + + @Override + public ReferenceValue getGlobalAssetId() { + return globalAssetId; + } + + @Override + public void setGlobalAssetId(ReferenceValue globalAssetId) { + this.globalAssetId = globalAssetId; + } + + @Override + public List getSpecificAssetIds() { + return specificAssetIds; + } + + @Override + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; + } + + @Override + public List getStatements() { + return statements; + } + + @Override + public void setStatements(List statements) { + this.statements = statements; + } + + public String toString() { + return String.format( + "DefaultEntityValue (" + "entityType=%s," + + "globalAssetId=%s," + + "specificAssetIds=%s," + + "statements=%s," + + ")", + this.entityType, this.globalAssetId, this.specificAssetIds, this.statements); + } + + /** + * This builder class can be used to construct a DefaultEntityValue bean. + */ + public static class Builder extends EntityValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultEntityValue newBuildingInstance() { + return new DefaultEntityValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java new file mode 100644 index 000000000..593a4acc7 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.FileMetadata + * + */ + +@IRI("aas:FileMetadata") +public class DefaultFileMetadata implements FileMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultFileMetadata() {} + + public DefaultFileMetadata(FileMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultFileMetadata other = (DefaultFileMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultFileMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultFileMetadata bean. + */ + public static class Builder extends FileMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultFileMetadata newBuildingInstance() { + return new DefaultFileMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java new file mode 100644 index 000000000..cee3bfd30 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.FileValue + * + */ + +@IRI("aas:FileValue") +public class DefaultFileValue implements FileValue { + + @IRI("https://admin-shell.io/aas/3/0/FileValue/contentType") + protected String contentType; + + @IRI("https://admin-shell.io/aas/3/0/FileValue/value") + protected String value; + + public DefaultFileValue() {} + + public DefaultFileValue(FileValue x) { + this.contentType = x.getContentType(); + this.value = x.getValue(); + } + + @Override + public int hashCode() { + return Objects.hash(this.contentType, + this.value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultFileValue other = (DefaultFileValue) obj; + return Objects.equals(this.contentType, other.contentType) && + Objects.equals(this.value, other.value); + } + } + + @Override + public String getContentType() { + return contentType; + } + + @Override + public void setContentType(String contentType) { + this.contentType = contentType; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + public String toString() { + return String.format( + "DefaultFileValue (" + "contentType=%s," + + "value=%s," + + ")", + this.contentType, this.value); + } + + /** + * This builder class can be used to construct a DefaultFileValue bean. + */ + public static class Builder extends FileValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultFileValue newBuildingInstance() { + return new DefaultFileValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java new file mode 100644 index 000000000..d455c9c1c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Message + * + */ + +@IRI("aas:Message") +public class DefaultMessage implements Message { + + @IRI("https://admin-shell.io/aas/3/0/Message/code") + protected String code; + + @IRI("https://admin-shell.io/aas/3/0/Message/messageType") + protected MessageType messageType; + + @IRI("https://admin-shell.io/aas/3/0/Message/text") + protected String text; + + @IRI("https://admin-shell.io/aas/3/0/Message/timestamp") + protected String timestamp; + + public DefaultMessage() {} + + public DefaultMessage(Message x) { + this.code = x.getCode(); + this.messageType = x.getMessageType(); + this.text = x.getText(); + this.timestamp = x.getTimestamp(); + } + + @Override + public int hashCode() { + return Objects.hash(this.code, + this.messageType, + this.text, + this.timestamp); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultMessage other = (DefaultMessage) obj; + return Objects.equals(this.code, other.code) && + Objects.equals(this.messageType, other.messageType) && + Objects.equals(this.text, other.text) && + Objects.equals(this.timestamp, other.timestamp); + } + } + + @Override + public String getCode() { + return code; + } + + @Override + public void setCode(String code) { + this.code = code; + } + + @Override + public MessageType getMessageType() { + return messageType; + } + + @Override + public void setMessageType(MessageType messageType) { + this.messageType = messageType; + } + + @Override + public String getText() { + return text; + } + + @Override + public void setText(String text) { + this.text = text; + } + + @Override + public String getTimestamp() { + return timestamp; + } + + @Override + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String toString() { + return String.format( + "DefaultMessage (" + "code=%s," + + "messageType=%s," + + "text=%s," + + "timestamp=%s," + + ")", + this.code, this.messageType, this.text, this.timestamp); + } + + /** + * This builder class can be used to construct a DefaultMessage bean. + */ + public static class Builder extends MessageBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultMessage newBuildingInstance() { + return new DefaultMessage(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java new file mode 100644 index 000000000..beaad42ce --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyMetadata + * + */ + +@IRI("aas:MultiLanguagePropertyMetadata") +public class DefaultMultiLanguagePropertyMetadata implements MultiLanguagePropertyMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultMultiLanguagePropertyMetadata() {} + + public DefaultMultiLanguagePropertyMetadata(MultiLanguagePropertyMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultMultiLanguagePropertyMetadata other = (DefaultMultiLanguagePropertyMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultMultiLanguagePropertyMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultMultiLanguagePropertyMetadata bean. + */ + public static class Builder extends MultiLanguagePropertyMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultMultiLanguagePropertyMetadata newBuildingInstance() { + return new DefaultMultiLanguagePropertyMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java new file mode 100644 index 000000000..76f517b3d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyValue + * + */ + +@IRI("aas:MultiLanguagePropertyValue") +public class DefaultMultiLanguagePropertyValue implements MultiLanguagePropertyValue { + + public DefaultMultiLanguagePropertyValue() {} + + public DefaultMultiLanguagePropertyValue(MultiLanguagePropertyValue x) { + + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } + return true; + } + + public String toString() { + return String.format( + "DefaultMultiLanguagePropertyValue (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultMultiLanguagePropertyValue bean. + */ + public static class Builder extends MultiLanguagePropertyValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultMultiLanguagePropertyValue newBuildingInstance() { + return new DefaultMultiLanguagePropertyValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java new file mode 100644 index 000000000..7eb20d097 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.NumberValue + * + */ + +@IRI("aas:NumberValue") +public class DefaultNumberValue implements NumberValue { + + public DefaultNumberValue() {} + + public DefaultNumberValue(NumberValue x) { + + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } + return true; + } + + public String toString() { + return String.format( + "DefaultNumberValue (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultNumberValue bean. + */ + public static class Builder extends NumberValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultNumberValue newBuildingInstance() { + return new DefaultNumberValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java new file mode 100644 index 000000000..228ff5052 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationHandle + * + */ + +@IRI("aas:OperationHandle") +public class DefaultOperationHandle implements OperationHandle { + + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/handleId") + protected String handleId; + + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/requestId") + protected String requestId; + + public DefaultOperationHandle() {} + + public DefaultOperationHandle(OperationHandle x) { + this.handleId = x.getHandleId(); + this.requestId = x.getRequestId(); + } + + @Override + public int hashCode() { + return Objects.hash(this.handleId, + this.requestId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationHandle other = (DefaultOperationHandle) obj; + return Objects.equals(this.handleId, other.handleId) && + Objects.equals(this.requestId, other.requestId); + } + } + + @Override + public String getHandleId() { + return handleId; + } + + @Override + public void setHandleId(String handleId) { + this.handleId = handleId; + } + + @Override + public String getRequestId() { + return requestId; + } + + @Override + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public String toString() { + return String.format( + "DefaultOperationHandle (" + "handleId=%s," + + "requestId=%s," + + ")", + this.handleId, this.requestId); + } + + /** + * This builder class can be used to construct a DefaultOperationHandle bean. + */ + public static class Builder extends OperationHandleBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationHandle newBuildingInstance() { + return new DefaultOperationHandle(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java new file mode 100644 index 000000000..a059e226e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationMetadata + * + */ + +@IRI("aas:OperationMetadata") +public class DefaultOperationMetadata implements OperationMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultOperationMetadata() {} + + public DefaultOperationMetadata(OperationMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationMetadata other = (DefaultOperationMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultOperationMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultOperationMetadata bean. + */ + public static class Builder extends OperationMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationMetadata newBuildingInstance() { + return new DefaultOperationMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java new file mode 100644 index 000000000..b147b94a4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.math.BigInteger; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest + * + */ + +@IRI("aas:OperationRequest") +public class DefaultOperationRequest implements OperationRequest { + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") + protected OperationVariable inoutputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") + protected OperationVariable inputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/requestId") + protected String requestId; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/timeout") + protected BigInteger timeout; + + public DefaultOperationRequest() {} + + public DefaultOperationRequest(OperationRequest x) { + this.inoutputArguments = x.getInoutputArguments(); + this.inputArguments = x.getInputArguments(); + this.requestId = x.getRequestId(); + this.timeout = x.getTimeout(); + } + + @Override + public int hashCode() { + return Objects.hash(this.inoutputArguments, + this.inputArguments, + this.requestId, + this.timeout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationRequest other = (DefaultOperationRequest) obj; + return Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.inputArguments, other.inputArguments) && + Objects.equals(this.requestId, other.requestId) && + Objects.equals(this.timeout, other.timeout); + } + } + + @Override + public OperationVariable getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(OperationVariable inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public OperationVariable getInputArguments() { + return inputArguments; + } + + @Override + public void setInputArguments(OperationVariable inputArguments) { + this.inputArguments = inputArguments; + } + + @Override + public String getRequestId() { + return requestId; + } + + @Override + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + @Override + public BigInteger getTimeout() { + return timeout; + } + + @Override + public void setTimeout(BigInteger timeout) { + this.timeout = timeout; + } + + public String toString() { + return String.format( + "DefaultOperationRequest (" + "inoutputArguments=%s," + + "inputArguments=%s," + + "requestId=%s," + + "timeout=%s," + + ")", + this.inoutputArguments, this.inputArguments, this.requestId, this.timeout); + } + + /** + * This builder class can be used to construct a DefaultOperationRequest bean. + */ + public static class Builder extends OperationRequestBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationRequest newBuildingInstance() { + return new DefaultOperationRequest(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java new file mode 100644 index 000000000..a46ce9cf0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.math.BigInteger; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.OperationRequestValueOnly + * + */ + +@IRI("aas:OperationRequestValueOnly") +public class DefaultOperationRequestValueOnly implements OperationRequestValueOnly { + + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments") + protected String inoutputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments") + protected String inputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId") + protected String requestId; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout") + protected BigInteger timeout; + + public DefaultOperationRequestValueOnly() {} + + public DefaultOperationRequestValueOnly(OperationRequestValueOnly x) { + this.inoutputArguments = x.getInoutputArguments(); + this.inputArguments = x.getInputArguments(); + this.requestId = x.getRequestId(); + this.timeout = x.getTimeout(); + } + + @Override + public int hashCode() { + return Objects.hash(this.inoutputArguments, + this.inputArguments, + this.requestId, + this.timeout); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationRequestValueOnly other = (DefaultOperationRequestValueOnly) obj; + return Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.inputArguments, other.inputArguments) && + Objects.equals(this.requestId, other.requestId) && + Objects.equals(this.timeout, other.timeout); + } + } + + @Override + public String getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(String inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public String getInputArguments() { + return inputArguments; + } + + @Override + public void setInputArguments(String inputArguments) { + this.inputArguments = inputArguments; + } + + @Override + public String getRequestId() { + return requestId; + } + + @Override + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + @Override + public BigInteger getTimeout() { + return timeout; + } + + @Override + public void setTimeout(BigInteger timeout) { + this.timeout = timeout; + } + + public String toString() { + return String.format( + "DefaultOperationRequestValueOnly (" + "inoutputArguments=%s," + + "inputArguments=%s," + + "requestId=%s," + + "timeout=%s," + + ")", + this.inoutputArguments, this.inputArguments, this.requestId, this.timeout); + } + + /** + * This builder class can be used to construct a DefaultOperationRequestValueOnly bean. + */ + public static class Builder extends OperationRequestValueOnlyBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationRequestValueOnly newBuildingInstance() { + return new DefaultOperationRequestValueOnly(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java new file mode 100644 index 000000000..c364deba9 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationResult + * + */ + +@IRI("aas:OperationResult") +public class DefaultOperationResult implements OperationResult { + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionResult") + protected Result executionResult; + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionState") + protected ExecutionState executionState; + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") + protected OperationVariable inoutputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") + protected OperationVariable outputArguments; + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/requestId") + protected String requestId; + + public DefaultOperationResult() {} + + public DefaultOperationResult(OperationResult x) { + this.executionResult = x.getExecutionResult(); + this.executionState = x.getExecutionState(); + this.inoutputArguments = x.getInoutputArguments(); + this.outputArguments = x.getOutputArguments(); + this.requestId = x.getRequestId(); + } + + @Override + public int hashCode() { + return Objects.hash(this.executionResult, + this.executionState, + this.inoutputArguments, + this.outputArguments, + this.requestId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationResult other = (DefaultOperationResult) obj; + return Objects.equals(this.executionResult, other.executionResult) && + Objects.equals(this.executionState, other.executionState) && + Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.outputArguments, other.outputArguments) && + Objects.equals(this.requestId, other.requestId); + } + } + + @Override + public Result getExecutionResult() { + return executionResult; + } + + @Override + public void setExecutionResult(Result executionResult) { + this.executionResult = executionResult; + } + + @Override + public ExecutionState getExecutionState() { + return executionState; + } + + @Override + public void setExecutionState(ExecutionState executionState) { + this.executionState = executionState; + } + + @Override + public OperationVariable getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(OperationVariable inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public OperationVariable getOutputArguments() { + return outputArguments; + } + + @Override + public void setOutputArguments(OperationVariable outputArguments) { + this.outputArguments = outputArguments; + } + + @Override + public String getRequestId() { + return requestId; + } + + @Override + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public String toString() { + return String.format( + "DefaultOperationResult (" + "executionResult=%s," + + "executionState=%s," + + "inoutputArguments=%s," + + "outputArguments=%s," + + "requestId=%s," + + ")", + this.executionResult, this.executionState, this.inoutputArguments, this.outputArguments, this.requestId); + } + + /** + * This builder class can be used to construct a DefaultOperationResult bean. + */ + public static class Builder extends OperationResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationResult newBuildingInstance() { + return new DefaultOperationResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java new file mode 100644 index 000000000..f499cc462 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationResultValueOnly + * + */ + +@IRI("aas:OperationResultValueOnly") +public class DefaultOperationResultValueOnly implements OperationResultValueOnly { + + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult") + protected List executionResult = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState") + protected List executionState = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments") + protected List inoutputArguments = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments") + protected List outputArguments = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId") + protected List requestId = new ArrayList<>(); + + public DefaultOperationResultValueOnly() {} + + public DefaultOperationResultValueOnly(OperationResultValueOnly x) { + this.executionResult = x.getExecutionResult(); + this.executionState = x.getExecutionState(); + this.inoutputArguments = x.getInoutputArguments(); + this.outputArguments = x.getOutputArguments(); + this.requestId = x.getRequestId(); + } + + @Override + public int hashCode() { + return Objects.hash(this.executionResult, + this.executionState, + this.inoutputArguments, + this.outputArguments, + this.requestId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationResultValueOnly other = (DefaultOperationResultValueOnly) obj; + return Objects.equals(this.executionResult, other.executionResult) && + Objects.equals(this.executionState, other.executionState) && + Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.outputArguments, other.outputArguments) && + Objects.equals(this.requestId, other.requestId); + } + } + + @Override + public List getExecutionResult() { + return executionResult; + } + + @Override + public void setExecutionResult(List executionResults) { + this.executionResult = executionResults; + } + + @Override + public List getExecutionState() { + return executionState; + } + + @Override + public void setExecutionState(List executionStates) { + this.executionState = executionStates; + } + + @Override + public List getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(List inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public List getOutputArguments() { + return outputArguments; + } + + @Override + public void setOutputArguments(List outputArguments) { + this.outputArguments = outputArguments; + } + + @Override + public List getRequestId() { + return requestId; + } + + @Override + public void setRequestId(List requestIds) { + this.requestId = requestIds; + } + + public String toString() { + return String.format( + "DefaultOperationResultValueOnly (" + "executionResult=%s," + + "executionState=%s," + + "inoutputArguments=%s," + + "outputArguments=%s," + + "requestId=%s," + + ")", + this.executionResult, this.executionState, this.inoutputArguments, this.outputArguments, this.requestId); + } + + /** + * This builder class can be used to construct a DefaultOperationResultValueOnly bean. + */ + public static class Builder extends OperationResultValueOnlyBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationResultValueOnly newBuildingInstance() { + return new DefaultOperationResultValueOnly(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java new file mode 100644 index 000000000..0012b78d1 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.PackageDescription + * + */ + +@IRI("aas:PackageDescription") +public class DefaultPackageDescription implements PackageDescription { + + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/items") + protected List items = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/packageId") + protected String packageId; + + public DefaultPackageDescription() {} + + public DefaultPackageDescription(PackageDescription x) { + this.items = x.getItems(); + this.packageId = x.getPackageId(); + } + + @Override + public int hashCode() { + return Objects.hash(this.items, + this.packageId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultPackageDescription other = (DefaultPackageDescription) obj; + return Objects.equals(this.items, other.items) && + Objects.equals(this.packageId, other.packageId); + } + } + + @Override + public List getItems() { + return items; + } + + @Override + public void setItems(List items) { + this.items = items; + } + + @Override + public String getPackageId() { + return packageId; + } + + @Override + public void setPackageId(String packageId) { + this.packageId = packageId; + } + + public String toString() { + return String.format( + "DefaultPackageDescription (" + "items=%s," + + "packageId=%s," + + ")", + this.items, this.packageId); + } + + /** + * This builder class can be used to construct a DefaultPackageDescription bean. + */ + public static class Builder extends PackageDescriptionBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultPackageDescription newBuildingInstance() { + return new DefaultPackageDescription(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java new file mode 100644 index 000000000..41bbdb0a2 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.PropertyMetadata + * + */ + +@IRI("aas:PropertyMetadata") +public class DefaultPropertyMetadata implements PropertyMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/PropertyMetadata/valueType") + protected DataTypeDefXsd valueType; + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultPropertyMetadata() {} + + public DefaultPropertyMetadata(PropertyMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.valueType = x.getValueType(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.valueType, + this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultPropertyMetadata other = (DefaultPropertyMetadata) obj; + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultPropertyMetadata (" + "valueType=%s," + + ")", + this.valueType); + } + + /** + * This builder class can be used to construct a DefaultPropertyMetadata bean. + */ + public static class Builder extends PropertyMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultPropertyMetadata newBuildingInstance() { + return new DefaultPropertyMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java new file mode 100644 index 000000000..48fc44a56 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RangeMetadata + * + */ + +@IRI("aas:RangeMetadata") +public class DefaultRangeMetadata implements RangeMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/RangeMetadata/valueType") + protected DataTypeDefXsd valueType; + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultRangeMetadata() {} + + public DefaultRangeMetadata(RangeMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.valueType = x.getValueType(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.valueType, + this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultRangeMetadata other = (DefaultRangeMetadata) obj; + return Objects.equals(this.valueType, other.valueType) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public DataTypeDefXsd getValueType() { + return valueType; + } + + @Override + public void setValueType(DataTypeDefXsd valueType) { + this.valueType = valueType; + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultRangeMetadata (" + "valueType=%s," + + ")", + this.valueType); + } + + /** + * This builder class can be used to construct a DefaultRangeMetadata bean. + */ + public static class Builder extends RangeMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultRangeMetadata newBuildingInstance() { + return new DefaultRangeMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java new file mode 100644 index 000000000..505a4e65c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.math.BigInteger; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RangeValue + * + */ + +@IRI("aas:RangeValue") +public class DefaultRangeValue implements RangeValue { + + @IRI("https://admin-shell.io/aas/3/0/RangeValue/max") + protected BigInteger max; + + @IRI("https://admin-shell.io/aas/3/0/RangeValue/min") + protected BigInteger min; + + public DefaultRangeValue() {} + + public DefaultRangeValue(RangeValue x) { + this.max = x.getMax(); + this.min = x.getMin(); + } + + @Override + public int hashCode() { + return Objects.hash(this.max, + this.min); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultRangeValue other = (DefaultRangeValue) obj; + return Objects.equals(this.max, other.max) && + Objects.equals(this.min, other.min); + } + } + + @Override + public BigInteger getMax() { + return max; + } + + @Override + public void setMax(BigInteger max) { + this.max = max; + } + + @Override + public BigInteger getMin() { + return min; + } + + @Override + public void setMin(BigInteger min) { + this.min = min; + } + + public String toString() { + return String.format( + "DefaultRangeValue (" + "max=%s," + + "min=%s," + + ")", + this.max, this.min); + } + + /** + * This builder class can be used to construct a DefaultRangeValue bean. + */ + public static class Builder extends RangeValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultRangeValue newBuildingInstance() { + return new DefaultRangeValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java new file mode 100644 index 000000000..9d1c6e25f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementMetadata + * + */ + +@IRI("aas:ReferenceElementMetadata") +public class DefaultReferenceElementMetadata implements ReferenceElementMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultReferenceElementMetadata() {} + + public DefaultReferenceElementMetadata(ReferenceElementMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultReferenceElementMetadata other = (DefaultReferenceElementMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultReferenceElementMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultReferenceElementMetadata bean. + */ + public static class Builder extends ReferenceElementMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultReferenceElementMetadata newBuildingInstance() { + return new DefaultReferenceElementMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java new file mode 100644 index 000000000..9fcc9dad0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementValue + * + */ + +@IRI("aas:ReferenceElementValue") +public class DefaultReferenceElementValue implements ReferenceElementValue { + + @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") + protected List outputArguments = new ArrayList<>(); + + public DefaultReferenceElementValue() {} + + public DefaultReferenceElementValue(ReferenceElementValue x) { + this.outputArguments = x.getOutputArguments(); + } + + @Override + public int hashCode() { + return Objects.hash(this.outputArguments); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultReferenceElementValue other = (DefaultReferenceElementValue) obj; + return Objects.equals(this.outputArguments, other.outputArguments); + } + } + + @Override + public List getOutputArguments() { + return outputArguments; + } + + @Override + public void setOutputArguments(List outputArguments) { + this.outputArguments = outputArguments; + } + + public String toString() { + return String.format( + "DefaultReferenceElementValue (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultReferenceElementValue bean. + */ + public static class Builder extends ReferenceElementValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultReferenceElementValue newBuildingInstance() { + return new DefaultReferenceElementValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java new file mode 100644 index 000000000..6ff25d247 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue + * + */ + +@IRI("aas:ReferenceValue") +public class DefaultReferenceValue implements ReferenceValue { + + @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") + protected List outputArguments = new ArrayList<>(); + + public DefaultReferenceValue() {} + + public DefaultReferenceValue(ReferenceValue x) { + this.outputArguments = x.getOutputArguments(); + } + + @Override + public int hashCode() { + return Objects.hash(this.outputArguments); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultReferenceValue other = (DefaultReferenceValue) obj; + return Objects.equals(this.outputArguments, other.outputArguments); + } + } + + @Override + public List getOutputArguments() { + return outputArguments; + } + + @Override + public void setOutputArguments(List outputArguments) { + this.outputArguments = outputArguments; + } + + public String toString() { + return String.format( + "DefaultReferenceValue (" + "outputArguments=%s," + + ")", + this.outputArguments); + } + + /** + * This builder class can be used to construct a DefaultReferenceValue bean. + */ + public static class Builder extends ReferenceValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultReferenceValue newBuildingInstance() { + return new DefaultReferenceValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java new file mode 100644 index 000000000..e473039b5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementMetadata + * + */ + +@IRI("aas:RelationshipElementMetadata") +public class DefaultRelationshipElementMetadata implements RelationshipElementMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultRelationshipElementMetadata() {} + + public DefaultRelationshipElementMetadata(RelationshipElementMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultRelationshipElementMetadata other = (DefaultRelationshipElementMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultRelationshipElementMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultRelationshipElementMetadata bean. + */ + public static class Builder extends RelationshipElementMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultRelationshipElementMetadata newBuildingInstance() { + return new DefaultRelationshipElementMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java new file mode 100644 index 000000000..e8a71cb2d --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementValue + * + */ + +@IRI("aas:RelationshipElementValue") +public class DefaultRelationshipElementValue implements RelationshipElementValue { + + @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/first") + protected ReferenceValue first; + + @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/second") + protected ReferenceValue second; + + public DefaultRelationshipElementValue() {} + + public DefaultRelationshipElementValue(RelationshipElementValue x) { + this.first = x.getFirst(); + this.second = x.getSecond(); + } + + @Override + public int hashCode() { + return Objects.hash(this.first, + this.second); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultRelationshipElementValue other = (DefaultRelationshipElementValue) obj; + return Objects.equals(this.first, other.first) && + Objects.equals(this.second, other.second); + } + } + + @Override + public ReferenceValue getFirst() { + return first; + } + + @Override + public void setFirst(ReferenceValue first) { + this.first = first; + } + + @Override + public ReferenceValue getSecond() { + return second; + } + + @Override + public void setSecond(ReferenceValue second) { + this.second = second; + } + + public String toString() { + return String.format( + "DefaultRelationshipElementValue (" + "first=%s," + + "second=%s," + + ")", + this.first, this.second); + } + + /** + * This builder class can be used to construct a DefaultRelationshipElementValue bean. + */ + public static class Builder extends RelationshipElementValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultRelationshipElementValue newBuildingInstance() { + return new DefaultRelationshipElementValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java new file mode 100644 index 000000000..1aa9e40ef --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Result + * + */ + +@IRI("aas:Result") +public class DefaultResult implements Result { + + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + protected List messages = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Result/success") + protected boolean success; + + public DefaultResult() {} + + public DefaultResult(Result x) { + this.messages = x.getMessages(); + this.success = x.getSuccess(); + } + + @Override + public int hashCode() { + return Objects.hash(this.messages, + this.success); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultResult other = (DefaultResult) obj; + return Objects.equals(this.messages, other.messages) && + Objects.equals(this.success, other.success); + } + } + + @Override + public List getMessages() { + return messages; + } + + @Override + public void setMessages(List messages) { + this.messages = messages; + } + + @Override + public boolean getSuccess() { + return success; + } + + @Override + public void setSuccess(boolean success) { + this.success = success; + } + + public String toString() { + return String.format( + "DefaultResult (" + "messages=%s," + + "success=%s," + + ")", + this.messages, this.success); + } + + /** + * This builder class can be used to construct a DefaultResult bean. + */ + public static class Builder extends ResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultResult newBuildingInstance() { + return new DefaultResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java new file mode 100644 index 000000000..723626602 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.StringValue + * + */ + +@IRI("aas:StringValue") +public class DefaultStringValue implements StringValue { + + public DefaultStringValue() {} + + public DefaultStringValue(StringValue x) { + + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } + return true; + } + + public String toString() { + return String.format( + "DefaultStringValue (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultStringValue bean. + */ + public static class Builder extends StringValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultStringValue newBuildingInstance() { + return new DefaultStringValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java new file mode 100644 index 000000000..ab02c4942 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementAttributes + * + */ + +@IRI("aas:SubmodelElementAttributes") +public class DefaultSubmodelElementAttributes implements SubmodelElementAttributes { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultSubmodelElementAttributes() {} + + public DefaultSubmodelElementAttributes(SubmodelElementAttributes x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelElementAttributes other = (DefaultSubmodelElementAttributes) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultSubmodelElementAttributes (" + "kind=%s," + + ")", + this.kind); + } + + /** + * This builder class can be used to construct a DefaultSubmodelElementAttributes bean. + */ + public static class Builder extends SubmodelElementAttributesBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelElementAttributes newBuildingInstance() { + return new DefaultSubmodelElementAttributes(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java new file mode 100644 index 000000000..6a7410f34 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollectionMetadata + * + */ + +@IRI("aas:SubmodelElementCollectionMetadata") +public class DefaultSubmodelElementCollectionMetadata implements SubmodelElementCollectionMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + public DefaultSubmodelElementCollectionMetadata() {} + + public DefaultSubmodelElementCollectionMetadata(SubmodelElementCollectionMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelElementCollectionMetadata other = (DefaultSubmodelElementCollectionMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultSubmodelElementCollectionMetadata (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultSubmodelElementCollectionMetadata bean. + */ + public static class Builder extends SubmodelElementCollectionMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelElementCollectionMetadata newBuildingInstance() { + return new DefaultSubmodelElementCollectionMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java new file mode 100644 index 000000000..d3d4a7989 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListMetadata + * + */ + +@IRI("aas:SubmodelElementListMetadata") +public class DefaultSubmodelElementListMetadata implements SubmodelElementListMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") + protected ModellingKind kind; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant") + protected boolean orderRelevant; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement") + protected Reference semanticIdListElement; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement") + protected ModelType typeValueListElement; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement") + protected DataTypeDefXsd valueTypeListElement; + + public DefaultSubmodelElementListMetadata() {} + + public DefaultSubmodelElementListMetadata(SubmodelElementListMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + this.orderRelevant = x.getOrderRelevant(); + this.semanticIdListElement = x.getSemanticIdListElement(); + this.typeValueListElement = x.getTypeValueListElement(); + this.valueTypeListElement = x.getValueTypeListElement(); + } + + @Override + public int hashCode() { + return Objects.hash(this.orderRelevant, + this.semanticIdListElement, + this.typeValueListElement, + this.valueTypeListElement, + this.kind, + this.embeddedDataSpecifications, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelElementListMetadata other = (DefaultSubmodelElementListMetadata) obj; + return Objects.equals(this.orderRelevant, other.orderRelevant) && + Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && + Objects.equals(this.typeValueListElement, other.typeValueListElement) && + Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && + Objects.equals(this.kind, other.kind) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public boolean getOrderRelevant() { + return orderRelevant; + } + + @Override + public void setOrderRelevant(boolean orderRelevant) { + this.orderRelevant = orderRelevant; + } + + @Override + public Reference getSemanticIdListElement() { + return semanticIdListElement; + } + + @Override + public void setSemanticIdListElement(Reference semanticIdListElement) { + this.semanticIdListElement = semanticIdListElement; + } + + @Override + public ModelType getTypeValueListElement() { + return typeValueListElement; + } + + @Override + public void setTypeValueListElement(ModelType typeValueListElement) { + this.typeValueListElement = typeValueListElement; + } + + @Override + public DataTypeDefXsd getValueTypeListElement() { + return valueTypeListElement; + } + + @Override + public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { + this.valueTypeListElement = valueTypeListElement; + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultSubmodelElementListMetadata (" + "orderRelevant=%s," + + "semanticIdListElement=%s," + + "typeValueListElement=%s," + + "valueTypeListElement=%s," + + ")", + this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement); + } + + /** + * This builder class can be used to construct a DefaultSubmodelElementListMetadata bean. + */ + public static class Builder extends SubmodelElementListMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelElementListMetadata newBuildingInstance() { + return new DefaultSubmodelElementListMetadata(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java new file mode 100644 index 000000000..0094104b5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListValue + * + */ + +@IRI("aas:SubmodelElementListValue") +public class DefaultSubmodelElementListValue implements SubmodelElementListValue { + + public DefaultSubmodelElementListValue() {} + + public DefaultSubmodelElementListValue(SubmodelElementListValue x) { + + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } + return true; + } + + public String toString() { + return String.format( + "DefaultSubmodelElementListValue (" + + ")" + + ); + } + + /** + * This builder class can be used to construct a DefaultSubmodelElementListValue bean. + */ + public static class Builder extends SubmodelElementListValueBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelElementListValue newBuildingInstance() { + return new DefaultSubmodelElementListValue(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java new file mode 100644 index 000000000..87b328ab7 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelMetadata + * + */ + +@IRI("aas:SubmodelMetadata") +public class DefaultSubmodelMetadata implements SubmodelMetadata { + + @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") + protected List embeddedDataSpecifications = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") + protected List supplementalSemanticIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") + protected String id; + + @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") + protected List qualifiers = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/category") + protected String category; + + @IRI("https://admin-shell.io/aas/3/0/Referable/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelMetadata/kind") + protected ModellingKind kind; + + public DefaultSubmodelMetadata() {} + + public DefaultSubmodelMetadata(SubmodelMetadata x) { + this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); + this.extensions = x.getExtensions(); + this.semanticId = x.getSemanticId(); + this.supplementalSemanticIds = x.getSupplementalSemanticIds(); + this.administration = x.getAdministration(); + this.id = x.getId(); + this.qualifiers = x.getQualifiers(); + this.category = x.getCategory(); + this.description = x.getDescription(); + this.displayName = x.getDisplayName(); + this.idShort = x.getIdShort(); + this.kind = x.getKind(); + } + + @Override + public int hashCode() { + return Objects.hash(this.kind, + this.administration, + this.id, + this.category, + this.idShort, + this.displayName, + this.description, + this.extensions, + this.embeddedDataSpecifications, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelMetadata other = (DefaultSubmodelMetadata) obj; + return Objects.equals(this.kind, other.kind) && + Objects.equals(this.administration, other.administration) && + Objects.equals(this.id, other.id) && + Objects.equals(this.category, other.category) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.description, other.description) && + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); + } + } + + @Override + public ModellingKind getKind() { + return kind; + } + + @Override + public void setKind(ModellingKind kind) { + this.kind = kind; + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public String getCategory() { + return category; + } + + @Override + public void setCategory(String category) { + this.category = category; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + public String toString() { + return String.format( + "DefaultSubmodelMetadata (" + "kind=%s," + + ")", + this.kind); + } + + /** + * This builder class can be used to construct a DefaultSubmodelMetadata bean. + */ + public static class Builder extends SubmodelMetadataBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelMetadata newBuildingInstance() { + return new DefaultSubmodelMetadata(); + } + } +} From dc380d225d09bbd1b5025e608d24f599437903af Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Fri, 28 Jul 2023 13:50:48 +0200 Subject: [PATCH 35/91] remove the copy constructor logic --- .../DefaultAdministrativeInformation.java | 8 -------- .../DefaultAnnotatedRelationshipElement.java | 15 -------------- ...tAnnotatedRelationshipElementMetadata.java | 13 ------------ ...aultAnnotatedRelationshipElementValue.java | 6 ------ .../impl/DefaultAssetAdministrationShell.java | 14 ------------- ...ultAssetAdministrationShellDescriptor.java | 15 -------------- ...faultAssetAdministrationShellMetadata.java | 12 ----------- .../model/impl/DefaultAssetInformation.java | 8 -------- .../model/impl/DefaultBasicEventElement.java | 20 ------------------- .../DefaultBasicEventElementMetadata.java | 20 ------------------- .../impl/DefaultBasicEventElementValue.java | 4 ---- .../aas4j/v3/model/impl/DefaultBlob.java | 14 ------------- .../v3/model/impl/DefaultBlobMetadata.java | 13 ------------ .../aas4j/v3/model/impl/DefaultBlobValue.java | 5 ----- .../v3/model/impl/DefaultCapability.java | 12 ----------- .../model/impl/DefaultCapabilityMetadata.java | 13 ------------ .../model/impl/DefaultConceptDescription.java | 12 ----------- .../DefaultDataSpecificationIec61360.java | 15 -------------- .../v3/model/impl/DefaultDescriptor.java | 6 ------ .../DefaultEmbeddedDataSpecification.java | 5 ----- .../aas4j/v3/model/impl/DefaultEndpoint.java | 5 ----- .../aas4j/v3/model/impl/DefaultEntity.java | 16 --------------- .../v3/model/impl/DefaultEntityMetadata.java | 13 ------------ .../v3/model/impl/DefaultEntityValue.java | 7 ------- .../v3/model/impl/DefaultEnvironment.java | 6 ------ .../v3/model/impl/DefaultEventPayload.java | 11 ---------- .../aas4j/v3/model/impl/DefaultExtension.java | 9 --------- .../aas4j/v3/model/impl/DefaultFile.java | 14 ------------- .../v3/model/impl/DefaultFileMetadata.java | 13 ------------ .../aas4j/v3/model/impl/DefaultFileValue.java | 5 ----- .../aas4j/v3/model/impl/DefaultKey.java | 5 ----- ...faultLangStringDefinitionTypeIec61360.java | 5 ----- .../model/impl/DefaultLangStringNameType.java | 5 ----- ...ltLangStringPreferredNameTypeIec61360.java | 5 ----- ...efaultLangStringShortNameTypeIec61360.java | 5 ----- .../model/impl/DefaultLangStringTextType.java | 5 ----- .../aas4j/v3/model/impl/DefaultLevelType.java | 7 ------- .../aas4j/v3/model/impl/DefaultMessage.java | 7 ------- .../impl/DefaultMultiLanguageProperty.java | 14 ------------- .../DefaultMultiLanguagePropertyMetadata.java | 13 ------------ .../DefaultMultiLanguagePropertyValue.java | 4 ---- .../v3/model/impl/DefaultNumberValue.java | 4 ---- .../aas4j/v3/model/impl/DefaultOperation.java | 15 -------------- .../v3/model/impl/DefaultOperationHandle.java | 5 ----- .../model/impl/DefaultOperationMetadata.java | 13 ------------ .../model/impl/DefaultOperationRequest.java | 7 ------- .../DefaultOperationRequestValueOnly.java | 7 ------- .../v3/model/impl/DefaultOperationResult.java | 8 -------- .../impl/DefaultOperationResultValueOnly.java | 8 -------- .../model/impl/DefaultOperationVariable.java | 4 ---- .../model/impl/DefaultPackageDescription.java | 5 ----- .../aas4j/v3/model/impl/DefaultProperty.java | 15 -------------- .../model/impl/DefaultPropertyMetadata.java | 14 ------------- .../impl/DefaultProtocolInformation.java | 9 --------- .../aas4j/v3/model/impl/DefaultQualifier.java | 10 ---------- .../aas4j/v3/model/impl/DefaultRange.java | 15 -------------- .../v3/model/impl/DefaultRangeMetadata.java | 14 ------------- .../v3/model/impl/DefaultRangeValue.java | 5 ----- .../aas4j/v3/model/impl/DefaultReference.java | 6 ------ .../model/impl/DefaultReferenceElement.java | 13 ------------ .../impl/DefaultReferenceElementMetadata.java | 13 ------------ .../impl/DefaultReferenceElementValue.java | 4 ---- .../v3/model/impl/DefaultReferenceValue.java | 4 ---- .../impl/DefaultRelationshipElement.java | 14 ------------- .../DefaultRelationshipElementMetadata.java | 13 ------------ .../impl/DefaultRelationshipElementValue.java | 5 ----- .../aas4j/v3/model/impl/DefaultResource.java | 5 ----- .../aas4j/v3/model/impl/DefaultResult.java | 5 ----- .../v3/model/impl/DefaultSpecificAssetId.java | 8 -------- .../v3/model/impl/DefaultStringValue.java | 4 ---- .../aas4j/v3/model/impl/DefaultSubmodel.java | 16 --------------- .../model/impl/DefaultSubmodelDescriptor.java | 12 ----------- .../DefaultSubmodelElementAttributes.java | 13 ------------ .../DefaultSubmodelElementCollection.java | 13 ------------ ...aultSubmodelElementCollectionMetadata.java | 13 ------------ .../impl/DefaultSubmodelElementList.java | 17 ---------------- .../DefaultSubmodelElementListMetadata.java | 17 ---------------- .../impl/DefaultSubmodelElementListValue.java | 4 ---- .../model/impl/DefaultSubmodelMetadata.java | 15 -------------- .../aas4j/v3/model/impl/DefaultValueList.java | 4 ---- .../model/impl/DefaultValueReferencePair.java | 5 ----- 81 files changed, 785 deletions(-) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java index b90f9e4ef..a15e6268a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAdministrativeInformation.java @@ -52,14 +52,6 @@ public class DefaultAdministrativeInformation implements AdministrativeInformati public DefaultAdministrativeInformation() {} - public DefaultAdministrativeInformation(AdministrativeInformation x) { - this.creator = x.getCreator(); - this.revision = x.getRevision(); - this.templateId = x.getTemplateId(); - this.version = x.getVersion(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - } - @Override public int hashCode() { return Objects.hash(this.version, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 4b3c37789..329f80088 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -74,21 +74,6 @@ public class DefaultAnnotatedRelationshipElement implements AnnotatedRelationshi public DefaultAnnotatedRelationshipElement() {} - public DefaultAnnotatedRelationshipElement(AnnotatedRelationshipElement x) { - this.annotations = x.getAnnotations(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.first = x.getFirst(); - this.second = x.getSecond(); - } - @Override public int hashCode() { return Objects.hash(this.annotations, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java index ae1f7192f..c64689626 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java @@ -66,19 +66,6 @@ public class DefaultAnnotatedRelationshipElementMetadata implements AnnotatedRel public DefaultAnnotatedRelationshipElementMetadata() {} - public DefaultAnnotatedRelationshipElementMetadata(AnnotatedRelationshipElementMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java index 964dcc426..ca83b0026 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java @@ -45,12 +45,6 @@ public class DefaultAnnotatedRelationshipElementValue implements AnnotatedRelati public DefaultAnnotatedRelationshipElementValue() {} - public DefaultAnnotatedRelationshipElementValue(AnnotatedRelationshipElementValue x) { - this.annotation = x.getAnnotation(); - this.first = x.getFirst(); - this.second = x.getSecond(); - } - @Override public int hashCode() { return Objects.hash(this.first, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 03568b196..7c1b9dde6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -69,20 +69,6 @@ public class DefaultAssetAdministrationShell implements AssetAdministrationShell public DefaultAssetAdministrationShell() {} - public DefaultAssetAdministrationShell(AssetAdministrationShell x) { - this.assetInformation = x.getAssetInformation(); - this.derivedFrom = x.getDerivedFrom(); - this.submodels = x.getSubmodels(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.administration = x.getAdministration(); - this.id = x.getId(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.derivedFrom, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java index e5b6ad662..2fb578a0e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -72,21 +72,6 @@ public class DefaultAssetAdministrationShellDescriptor implements AssetAdministr public DefaultAssetAdministrationShellDescriptor() {} - public DefaultAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor x) { - this.administration = x.getAdministration(); - this.assetKind = x.getAssetKind(); - this.assetType = x.getAssetType(); - this.endpoints = x.getEndpoints(); - this.globalAssetId = x.getGlobalAssetId(); - this.id = x.getId(); - this.idShort = x.getIdShort(); - this.specificAssetIds = x.getSpecificAssetIds(); - this.submodelDescriptors = x.getSubmodelDescriptors(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.extensions = x.getExtensions(); - } - @Override public int hashCode() { return Objects.hash(this.administration, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java index df48cd549..d55721505 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java @@ -63,18 +63,6 @@ public class DefaultAssetAdministrationShellMetadata implements AssetAdministrat public DefaultAssetAdministrationShellMetadata() {} - public DefaultAssetAdministrationShellMetadata(AssetAdministrationShellMetadata x) { - this.derivedFrom = x.getDerivedFrom(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.administration = x.getAdministration(); - this.id = x.getId(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.derivedFrom, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java index 6126b80e7..d692f620d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetInformation.java @@ -52,14 +52,6 @@ public class DefaultAssetInformation implements AssetInformation { public DefaultAssetInformation() {} - public DefaultAssetInformation(AssetInformation x) { - this.assetKind = x.getAssetKind(); - this.assetType = x.getAssetType(); - this.defaultThumbnail = x.getDefaultThumbnail(); - this.globalAssetId = x.getGlobalAssetId(); - this.specificAssetIds = x.getSpecificAssetIds(); - } - @Override public int hashCode() { return Objects.hash(this.assetKind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 366919da3..8dec10583 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -87,26 +87,6 @@ public class DefaultBasicEventElement implements BasicEventElement { public DefaultBasicEventElement() {} - public DefaultBasicEventElement(BasicEventElement x) { - this.direction = x.getDirection(); - this.lastUpdate = x.getLastUpdate(); - this.maxInterval = x.getMaxInterval(); - this.messageBroker = x.getMessageBroker(); - this.messageTopic = x.getMessageTopic(); - this.minInterval = x.getMinInterval(); - this.observed = x.getObserved(); - this.state = x.getState(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.observed, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java index 650554123..8d4d635e0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java @@ -87,26 +87,6 @@ public class DefaultBasicEventElementMetadata implements BasicEventElementMetada public DefaultBasicEventElementMetadata() {} - public DefaultBasicEventElementMetadata(BasicEventElementMetadata x) { - this.direction = x.getDirection(); - this.lastUpdate = x.getLastUpdate(); - this.maxInterval = x.getMaxInterval(); - this.messageBroker = x.getMessageBroker(); - this.messageTopic = x.getMessageTopic(); - this.minInterval = x.getMinInterval(); - this.state = x.getState(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.direction, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java index f513c62e5..8b0c32d24 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java @@ -38,10 +38,6 @@ public class DefaultBasicEventElementValue implements BasicEventElementValue { public DefaultBasicEventElementValue() {} - public DefaultBasicEventElementValue(BasicEventElementValue x) { - this.observed = x.getObserved(); - } - @Override public int hashCode() { return Objects.hash(this.observed); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 63822dc30..95c58a399 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -71,20 +71,6 @@ public class DefaultBlob implements Blob { public DefaultBlob() {} - public DefaultBlob(Blob x) { - this.contentType = x.getContentType(); - this.value = x.getValue(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(Arrays.hashCode(this.value), diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java index 294be7279..e0a8b3493 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java @@ -65,19 +65,6 @@ public class DefaultBlobMetadata implements BlobMetadata { public DefaultBlobMetadata() {} - public DefaultBlobMetadata(BlobMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java index 3d220c308..97a83436b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java @@ -39,11 +39,6 @@ public class DefaultBlobValue implements BlobValue { public DefaultBlobValue() {} - public DefaultBlobValue(BlobValue x) { - this.mimeType = x.getMimeType(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.mimeType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index 0f3006313..05bc7d2ac 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -64,18 +64,6 @@ public class DefaultCapability implements Capability { public DefaultCapability() {} - public DefaultCapability(Capability x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java index dfe77fb95..f60c05958 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java @@ -65,19 +65,6 @@ public class DefaultCapabilityMetadata implements CapabilityMetadata { public DefaultCapabilityMetadata() {} - public DefaultCapabilityMetadata(CapabilityMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 14d41dbe6..ada284306 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -64,18 +64,6 @@ public class DefaultConceptDescription implements ConceptDescription { public DefaultConceptDescription() {} - public DefaultConceptDescription(ConceptDescription x) { - this.isCaseOf = x.getIsCaseOf(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.administration = x.getAdministration(); - this.id = x.getId(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.isCaseOf, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java index 42f57c645..2363d2243 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDataSpecificationIec61360.java @@ -74,21 +74,6 @@ public class DefaultDataSpecificationIec61360 implements DataSpecificationIec613 public DefaultDataSpecificationIec61360() {} - public DefaultDataSpecificationIec61360(DataSpecificationIec61360 x) { - this.dataType = x.getDataType(); - this.definition = x.getDefinition(); - this.levelType = x.getLevelType(); - this.preferredName = x.getPreferredName(); - this.shortName = x.getShortName(); - this.sourceOfDefinition = x.getSourceOfDefinition(); - this.symbol = x.getSymbol(); - this.unit = x.getUnit(); - this.unitId = x.getUnitId(); - this.value = x.getValue(); - this.valueFormat = x.getValueFormat(); - this.valueList = x.getValueList(); - } - @Override public int hashCode() { return Objects.hash(this.preferredName, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java index 4ae3f5454..d4ff485ea 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java @@ -44,12 +44,6 @@ public class DefaultDescriptor implements Descriptor { public DefaultDescriptor() {} - public DefaultDescriptor(Descriptor x) { - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.extensions = x.getExtensions(); - } - @Override public int hashCode() { return Objects.hash(this.description, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java index e279bbd7c..1c12d7b46 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEmbeddedDataSpecification.java @@ -41,11 +41,6 @@ public class DefaultEmbeddedDataSpecification implements EmbeddedDataSpecificati public DefaultEmbeddedDataSpecification() {} - public DefaultEmbeddedDataSpecification(EmbeddedDataSpecification x) { - this.dataSpecification = x.getDataSpecification(); - this.dataSpecificationContent = x.getDataSpecificationContent(); - } - @Override public int hashCode() { return Objects.hash(this.dataSpecification, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java index 060c3a0e8..1f3dcb3f3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java @@ -39,11 +39,6 @@ public class DefaultEndpoint implements Endpoint { public DefaultEndpoint() {} - public DefaultEndpoint(Endpoint x) { - this._interface = x.get_interface(); - this.protocolInformation = x.getProtocolInformation(); - } - @Override public int hashCode() { return Objects.hash(this._interface, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index c2bb3ae38..dfe8f9f92 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -75,22 +75,6 @@ public class DefaultEntity implements Entity { public DefaultEntity() {} - public DefaultEntity(Entity x) { - this.entityType = x.getEntityType(); - this.globalAssetId = x.getGlobalAssetId(); - this.specificAssetIds = x.getSpecificAssetIds(); - this.statements = x.getStatements(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.statements, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java index cc3ee660e..324e5cb6b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java @@ -65,19 +65,6 @@ public class DefaultEntityMetadata implements EntityMetadata { public DefaultEntityMetadata() {} - public DefaultEntityMetadata(EntityMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java index 18b1e7539..879171654 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java @@ -47,13 +47,6 @@ public class DefaultEntityValue implements EntityValue { public DefaultEntityValue() {} - public DefaultEntityValue(EntityValue x) { - this.entityType = x.getEntityType(); - this.globalAssetId = x.getGlobalAssetId(); - this.specificAssetIds = x.getSpecificAssetIds(); - this.statements = x.getStatements(); - } - @Override public int hashCode() { return Objects.hash(this.entityType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java index 27e72bdfd..b3722ed21 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEnvironment.java @@ -45,12 +45,6 @@ public class DefaultEnvironment implements Environment { public DefaultEnvironment() {} - public DefaultEnvironment(Environment x) { - this.assetAdministrationShells = x.getAssetAdministrationShells(); - this.conceptDescriptions = x.getConceptDescriptions(); - this.submodels = x.getSubmodels(); - } - @Override public int hashCode() { return Objects.hash(this.assetAdministrationShells, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index ada88d61c..c78eae0fb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -59,17 +59,6 @@ public class DefaultEventPayload implements EventPayload { public DefaultEventPayload() {} - public DefaultEventPayload(EventPayload x) { - this.observableReference = x.getObservableReference(); - this.observableSemanticId = x.getObservableSemanticId(); - this.payload = x.getPayload(); - this.source = x.getSource(); - this.sourceSemanticId = x.getSourceSemanticId(); - this.subjectId = x.getSubjectId(); - this.timeStamp = x.getTimeStamp(); - this.topic = x.getTopic(); - } - @Override public int hashCode() { return Objects.hash(this.source, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index fd01dbfc2..3242edd75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -56,15 +56,6 @@ public DefaultExtension() { this.valueType = DataTypeDefXsd.STRING; } - public DefaultExtension(Extension x) { - this.name = x.getName(); - this.refersTo = x.getRefersTo(); - this.value = x.getValue(); - this.valueType = x.getValueType(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - } - @Override public int hashCode() { return Objects.hash(this.name, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 678fde2fe..f8b6e9854 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -69,20 +69,6 @@ public class DefaultFile implements File { public DefaultFile() {} - public DefaultFile(File x) { - this.contentType = x.getContentType(); - this.value = x.getValue(); - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.value, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java index 593a4acc7..9ed1c4c3c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java @@ -65,19 +65,6 @@ public class DefaultFileMetadata implements FileMetadata { public DefaultFileMetadata() {} - public DefaultFileMetadata(FileMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java index cee3bfd30..e25ba0a0a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java @@ -39,11 +39,6 @@ public class DefaultFileValue implements FileValue { public DefaultFileValue() {} - public DefaultFileValue(FileValue x) { - this.contentType = x.getContentType(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.contentType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java index ce3564955..f2bc0c781 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultKey.java @@ -40,11 +40,6 @@ public class DefaultKey implements Key { public DefaultKey() {} - public DefaultKey(Key x) { - this.type = x.getType(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.type, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java index df540bb93..5f63fb978 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringDefinitionTypeIec61360.java @@ -41,11 +41,6 @@ public class DefaultLangStringDefinitionTypeIec61360 implements LangStringDefini public DefaultLangStringDefinitionTypeIec61360() {} - public DefaultLangStringDefinitionTypeIec61360(LangStringDefinitionTypeIec61360 x) { - this.language = x.getLanguage(); - this.text = x.getText(); - } - @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java index f9230ad7e..44b53dfb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringNameType.java @@ -40,11 +40,6 @@ public class DefaultLangStringNameType implements LangStringNameType { public DefaultLangStringNameType() {} - public DefaultLangStringNameType(LangStringNameType x) { - this.language = x.getLanguage(); - this.text = x.getText(); - } - @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java index 00e4ea4ce..5a6b3044e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringPreferredNameTypeIec61360.java @@ -41,11 +41,6 @@ public class DefaultLangStringPreferredNameTypeIec61360 implements LangStringPre public DefaultLangStringPreferredNameTypeIec61360() {} - public DefaultLangStringPreferredNameTypeIec61360(LangStringPreferredNameTypeIec61360 x) { - this.language = x.getLanguage(); - this.text = x.getText(); - } - @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java index 326f7d300..dfa46dcbb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringShortNameTypeIec61360.java @@ -41,11 +41,6 @@ public class DefaultLangStringShortNameTypeIec61360 implements LangStringShortNa public DefaultLangStringShortNameTypeIec61360() {} - public DefaultLangStringShortNameTypeIec61360(LangStringShortNameTypeIec61360 x) { - this.language = x.getLanguage(); - this.text = x.getText(); - } - @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java index 12524954e..9cd617558 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLangStringTextType.java @@ -40,11 +40,6 @@ public class DefaultLangStringTextType implements LangStringTextType { public DefaultLangStringTextType() {} - public DefaultLangStringTextType(LangStringTextType x) { - this.language = x.getLanguage(); - this.text = x.getText(); - } - @Override public int hashCode() { return Objects.hash(this.language, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java index 987fcd731..e07d758fe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultLevelType.java @@ -47,13 +47,6 @@ public class DefaultLevelType implements LevelType { public DefaultLevelType() {} - public DefaultLevelType(LevelType x) { - this.max = x.getMax(); - this.min = x.getMin(); - this.nom = x.getNom(); - this.typ = x.getTyp(); - } - @Override public int hashCode() { return Objects.hash(this.min, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java index d455c9c1c..42dd4acac 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java @@ -45,13 +45,6 @@ public class DefaultMessage implements Message { public DefaultMessage() {} - public DefaultMessage(Message x) { - this.code = x.getCode(); - this.messageType = x.getMessageType(); - this.text = x.getText(); - this.timestamp = x.getTimestamp(); - } - @Override public int hashCode() { return Objects.hash(this.code, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 015eed191..adaa2cceb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -69,20 +69,6 @@ public class DefaultMultiLanguageProperty implements MultiLanguageProperty { public DefaultMultiLanguageProperty() {} - public DefaultMultiLanguageProperty(MultiLanguageProperty x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.value = x.getValue(); - this.valueId = x.getValueId(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.value, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java index beaad42ce..22f8abd4a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java @@ -66,19 +66,6 @@ public class DefaultMultiLanguagePropertyMetadata implements MultiLanguageProper public DefaultMultiLanguagePropertyMetadata() {} - public DefaultMultiLanguagePropertyMetadata(MultiLanguagePropertyMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java index 76f517b3d..237033862 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java @@ -34,10 +34,6 @@ public class DefaultMultiLanguagePropertyValue implements MultiLanguagePropertyV public DefaultMultiLanguagePropertyValue() {} - public DefaultMultiLanguagePropertyValue(MultiLanguagePropertyValue x) { - - } - @Override public int hashCode() { return Objects.hash(super.hashCode()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java index 7eb20d097..7a2d7bfe0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java @@ -33,10 +33,6 @@ public class DefaultNumberValue implements NumberValue { public DefaultNumberValue() {} - public DefaultNumberValue(NumberValue x) { - - } - @Override public int hashCode() { return Objects.hash(super.hashCode()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index cddee6979..e0ecffbf0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -72,21 +72,6 @@ public class DefaultOperation implements Operation { public DefaultOperation() {} - public DefaultOperation(Operation x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.inoutputVariables = x.getInoutputVariables(); - this.inputVariables = x.getInputVariables(); - this.outputVariables = x.getOutputVariables(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.inputVariables, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java index 228ff5052..dc1ae7cf8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java @@ -39,11 +39,6 @@ public class DefaultOperationHandle implements OperationHandle { public DefaultOperationHandle() {} - public DefaultOperationHandle(OperationHandle x) { - this.handleId = x.getHandleId(); - this.requestId = x.getRequestId(); - } - @Override public int hashCode() { return Objects.hash(this.handleId, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java index a059e226e..fd5bd9e43 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java @@ -65,19 +65,6 @@ public class DefaultOperationMetadata implements OperationMetadata { public DefaultOperationMetadata() {} - public DefaultOperationMetadata(OperationMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java index b147b94a4..64b69a9b6 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java @@ -46,13 +46,6 @@ public class DefaultOperationRequest implements OperationRequest { public DefaultOperationRequest() {} - public DefaultOperationRequest(OperationRequest x) { - this.inoutputArguments = x.getInoutputArguments(); - this.inputArguments = x.getInputArguments(); - this.requestId = x.getRequestId(); - this.timeout = x.getTimeout(); - } - @Override public int hashCode() { return Objects.hash(this.inoutputArguments, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java index a46ce9cf0..75daf81f8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java @@ -47,13 +47,6 @@ public class DefaultOperationRequestValueOnly implements OperationRequestValueOn public DefaultOperationRequestValueOnly() {} - public DefaultOperationRequestValueOnly(OperationRequestValueOnly x) { - this.inoutputArguments = x.getInoutputArguments(); - this.inputArguments = x.getInputArguments(); - this.requestId = x.getRequestId(); - this.timeout = x.getTimeout(); - } - @Override public int hashCode() { return Objects.hash(this.inoutputArguments, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java index c364deba9..a5f93e6fe 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java @@ -48,14 +48,6 @@ public class DefaultOperationResult implements OperationResult { public DefaultOperationResult() {} - public DefaultOperationResult(OperationResult x) { - this.executionResult = x.getExecutionResult(); - this.executionState = x.getExecutionState(); - this.inoutputArguments = x.getInoutputArguments(); - this.outputArguments = x.getOutputArguments(); - this.requestId = x.getRequestId(); - } - @Override public int hashCode() { return Objects.hash(this.executionResult, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java index f499cc462..d5760895e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java @@ -50,14 +50,6 @@ public class DefaultOperationResultValueOnly implements OperationResultValueOnly public DefaultOperationResultValueOnly() {} - public DefaultOperationResultValueOnly(OperationResultValueOnly x) { - this.executionResult = x.getExecutionResult(); - this.executionState = x.getExecutionState(); - this.inoutputArguments = x.getInoutputArguments(); - this.outputArguments = x.getOutputArguments(); - this.requestId = x.getRequestId(); - } - @Override public int hashCode() { return Objects.hash(this.executionResult, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java index eeb59a52d..75d286203 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationVariable.java @@ -38,10 +38,6 @@ public class DefaultOperationVariable implements OperationVariable { public DefaultOperationVariable() {} - public DefaultOperationVariable(OperationVariable x) { - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.value); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java index 0012b78d1..49df8e38b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java @@ -41,11 +41,6 @@ public class DefaultPackageDescription implements PackageDescription { public DefaultPackageDescription() {} - public DefaultPackageDescription(PackageDescription x) { - this.items = x.getItems(); - this.packageId = x.getPackageId(); - } - @Override public int hashCode() { return Objects.hash(this.items, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index acca03333..dce33fc48 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -72,21 +72,6 @@ public class DefaultProperty implements Property { public DefaultProperty() {} - public DefaultProperty(Property x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.value = x.getValue(); - this.valueId = x.getValueId(); - this.valueType = x.getValueType(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.valueType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java index 41bbdb0a2..8d19dbd5a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java @@ -68,20 +68,6 @@ public class DefaultPropertyMetadata implements PropertyMetadata { public DefaultPropertyMetadata() {} - public DefaultPropertyMetadata(PropertyMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.valueType = x.getValueType(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.valueType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java index 4b0b7a105..b4680a749 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -53,15 +53,6 @@ public class DefaultProtocolInformation implements ProtocolInformation { public DefaultProtocolInformation() {} - public DefaultProtocolInformation(ProtocolInformation x) { - this.endpointProtocol = x.getEndpointProtocol(); - this.endpointProtocolVersion = x.getEndpointProtocolVersion(); - this.href = x.getHref(); - this.subprotocol = x.getSubprotocol(); - this.subprotocolBody = x.getSubprotocolBody(); - this.subprotocolBodyEncoding = x.getSubprotocolBodyEncoding(); - } - @Override public int hashCode() { return Objects.hash(this.href, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java index 4ef4f2d37..54041d0d5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultQualifier.java @@ -60,16 +60,6 @@ public DefaultQualifier() { this.kind = QualifierKind.CONCEPT_QUALIFIER; } - public DefaultQualifier(Qualifier x) { - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.kind = x.getKind(); - this.type = x.getType(); - this.value = x.getValue(); - this.valueId = x.getValueId(); - this.valueType = x.getValueType(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 525b31942..f375f6ad5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -72,21 +72,6 @@ public class DefaultRange implements Range { public DefaultRange() {} - public DefaultRange(Range x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.max = x.getMax(); - this.min = x.getMin(); - this.valueType = x.getValueType(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - } - @Override public int hashCode() { return Objects.hash(this.valueType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java index 48fc44a56..89f873e55 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java @@ -68,20 +68,6 @@ public class DefaultRangeMetadata implements RangeMetadata { public DefaultRangeMetadata() {} - public DefaultRangeMetadata(RangeMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.valueType = x.getValueType(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.valueType, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java index 505a4e65c..c36bf9a7d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java @@ -40,11 +40,6 @@ public class DefaultRangeValue implements RangeValue { public DefaultRangeValue() {} - public DefaultRangeValue(RangeValue x) { - this.max = x.getMax(); - this.min = x.getMin(); - } - @Override public int hashCode() { return Objects.hash(this.max, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java index ad3389db0..63f5f541f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReference.java @@ -45,12 +45,6 @@ public class DefaultReference implements Reference { public DefaultReference() {} - public DefaultReference(Reference x) { - this.keys = x.getKeys(); - this.referredSemanticId = x.getReferredSemanticId(); - this.type = x.getType(); - } - @Override public int hashCode() { return Objects.hash(this.type, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 8c3a4537c..72d3c5728 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -67,19 +67,6 @@ public class DefaultReferenceElement implements ReferenceElement { public DefaultReferenceElement() {} - public DefaultReferenceElement(ReferenceElement x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.value, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java index 9d1c6e25f..504619fc1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java @@ -65,19 +65,6 @@ public class DefaultReferenceElementMetadata implements ReferenceElementMetadata public DefaultReferenceElementMetadata() {} - public DefaultReferenceElementMetadata(ReferenceElementMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java index 9fcc9dad0..bd581e402 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java @@ -38,10 +38,6 @@ public class DefaultReferenceElementValue implements ReferenceElementValue { public DefaultReferenceElementValue() {} - public DefaultReferenceElementValue(ReferenceElementValue x) { - this.outputArguments = x.getOutputArguments(); - } - @Override public int hashCode() { return Objects.hash(this.outputArguments); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java index 6ff25d247..4181371e9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java @@ -38,10 +38,6 @@ public class DefaultReferenceValue implements ReferenceValue { public DefaultReferenceValue() {} - public DefaultReferenceValue(ReferenceValue x) { - this.outputArguments = x.getOutputArguments(); - } - @Override public int hashCode() { return Objects.hash(this.outputArguments); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 0a28e723b..5c8122c87 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -70,20 +70,6 @@ public class DefaultRelationshipElement implements RelationshipElement { public DefaultRelationshipElement() {} - public DefaultRelationshipElement(RelationshipElement x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.first = x.getFirst(); - this.second = x.getSecond(); - } - @Override public int hashCode() { return Objects.hash(this.first, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java index e473039b5..c0bda8ba1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java @@ -66,19 +66,6 @@ public class DefaultRelationshipElementMetadata implements RelationshipElementMe public DefaultRelationshipElementMetadata() {} - public DefaultRelationshipElementMetadata(RelationshipElementMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java index e8a71cb2d..dcfd166dc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java @@ -39,11 +39,6 @@ public class DefaultRelationshipElementValue implements RelationshipElementValue public DefaultRelationshipElementValue() {} - public DefaultRelationshipElementValue(RelationshipElementValue x) { - this.first = x.getFirst(); - this.second = x.getSecond(); - } - @Override public int hashCode() { return Objects.hash(this.first, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java index 6b3b72075..b158394bc 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResource.java @@ -41,11 +41,6 @@ public class DefaultResource implements Resource { public DefaultResource() {} - public DefaultResource(Resource x) { - this.contentType = x.getContentType(); - this.path = x.getPath(); - } - @Override public int hashCode() { return Objects.hash(this.path, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java index 1aa9e40ef..9d019b92d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java @@ -41,11 +41,6 @@ public class DefaultResult implements Result { public DefaultResult() {} - public DefaultResult(Result x) { - this.messages = x.getMessages(); - this.success = x.getSuccess(); - } - @Override public int hashCode() { return Objects.hash(this.messages, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java index 6971280f8..f53ffaa4c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSpecificAssetId.java @@ -51,14 +51,6 @@ public class DefaultSpecificAssetId implements SpecificAssetId { public DefaultSpecificAssetId() {} - public DefaultSpecificAssetId(SpecificAssetId x) { - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.externalSubjectId = x.getExternalSubjectId(); - this.name = x.getName(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.name, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java index 723626602..2a1203a75 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java @@ -33,10 +33,6 @@ public class DefaultStringValue implements StringValue { public DefaultStringValue() {} - public DefaultStringValue(StringValue x) { - - } - @Override public int hashCode() { return Objects.hash(super.hashCode()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java index 7a3f16df9..b1f909bc3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java @@ -77,22 +77,6 @@ public DefaultSubmodel() { this.kind = ModellingKind.INSTANCE; } - public DefaultSubmodel(Submodel x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.kind = x.getKind(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.administration = x.getAdministration(); - this.id = x.getId(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.submodelElements = x.getSubmodelElements(); - } - @Override public int hashCode() { return Objects.hash(this.submodelElements, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java index cda3b8b08..9c79609f9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -62,18 +62,6 @@ public class DefaultSubmodelDescriptor implements SubmodelDescriptor { public DefaultSubmodelDescriptor() {} - public DefaultSubmodelDescriptor(SubmodelDescriptor x) { - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.extensions = x.getExtensions(); - this.administration = x.getAdministration(); - this.endpoints = x.getEndpoints(); - this.id = x.getId(); - this.idShort = x.getIdShort(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticId = x.getSupplementalSemanticId(); - } - @Override public int hashCode() { return Objects.hash(this.administration, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java index ab02c4942..b3f3fe15c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java @@ -66,19 +66,6 @@ public class DefaultSubmodelElementAttributes implements SubmodelElementAttribut public DefaultSubmodelElementAttributes() {} - public DefaultSubmodelElementAttributes(SubmodelElementAttributes x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 0704959be..488e758b5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -68,19 +68,6 @@ public class DefaultSubmodelElementCollection implements SubmodelElementCollecti public DefaultSubmodelElementCollection() {} - public DefaultSubmodelElementCollection(SubmodelElementCollection x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.value = x.getValue(); - } - @Override public int hashCode() { return Objects.hash(this.value, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java index 6a7410f34..0cbeb83b5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java @@ -66,19 +66,6 @@ public class DefaultSubmodelElementCollectionMetadata implements SubmodelElement public DefaultSubmodelElementCollectionMetadata() {} - public DefaultSubmodelElementCollectionMetadata(SubmodelElementCollectionMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java index 6e366cd1f..51a9471c8 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementList.java @@ -80,23 +80,6 @@ public DefaultSubmodelElementList() { this.orderRelevant = Boolean.TRUE; } - public DefaultSubmodelElementList(SubmodelElementList x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.orderRelevant = x.getOrderRelevant(); - this.semanticIdListElement = x.getSemanticIdListElement(); - this.typeValueListElement = x.getTypeValueListElement(); - this.value = x.getValue(); - this.valueTypeListElement = x.getValueTypeListElement(); - } - @Override public int hashCode() { return Objects.hash(this.orderRelevant, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java index d3d4a7989..299be67d4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java @@ -78,23 +78,6 @@ public class DefaultSubmodelElementListMetadata implements SubmodelElementListMe public DefaultSubmodelElementListMetadata() {} - public DefaultSubmodelElementListMetadata(SubmodelElementListMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - this.orderRelevant = x.getOrderRelevant(); - this.semanticIdListElement = x.getSemanticIdListElement(); - this.typeValueListElement = x.getTypeValueListElement(); - this.valueTypeListElement = x.getValueTypeListElement(); - } - @Override public int hashCode() { return Objects.hash(this.orderRelevant, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java index 0094104b5..cd5b2d9e4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java @@ -33,10 +33,6 @@ public class DefaultSubmodelElementListValue implements SubmodelElementListValue public DefaultSubmodelElementListValue() {} - public DefaultSubmodelElementListValue(SubmodelElementListValue x) { - - } - @Override public int hashCode() { return Objects.hash(super.hashCode()); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java index 87b328ab7..b1710a604 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java @@ -71,21 +71,6 @@ public class DefaultSubmodelMetadata implements SubmodelMetadata { public DefaultSubmodelMetadata() {} - public DefaultSubmodelMetadata(SubmodelMetadata x) { - this.embeddedDataSpecifications = x.getEmbeddedDataSpecifications(); - this.extensions = x.getExtensions(); - this.semanticId = x.getSemanticId(); - this.supplementalSemanticIds = x.getSupplementalSemanticIds(); - this.administration = x.getAdministration(); - this.id = x.getId(); - this.qualifiers = x.getQualifiers(); - this.category = x.getCategory(); - this.description = x.getDescription(); - this.displayName = x.getDisplayName(); - this.idShort = x.getIdShort(); - this.kind = x.getKind(); - } - @Override public int hashCode() { return Objects.hash(this.kind, diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java index b955fec98..caf653d6b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueList.java @@ -39,10 +39,6 @@ public class DefaultValueList implements ValueList { public DefaultValueList() {} - public DefaultValueList(ValueList x) { - this.valueReferencePairs = x.getValueReferencePairs(); - } - @Override public int hashCode() { return Objects.hash(this.valueReferencePairs); diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java index a41506105..1dc00b780 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultValueReferencePair.java @@ -41,11 +41,6 @@ public class DefaultValueReferencePair implements ValueReferencePair { public DefaultValueReferencePair() {} - public DefaultValueReferencePair(ValueReferencePair x) { - this.value = x.getValue(); - this.valueId = x.getValueId(); - } - @Override public int hashCode() { return Objects.hash(this.value, From c60401e5c2bf5011fe012dbaeb8fd08dc13257e4 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Mon, 6 Nov 2023 18:18:41 +0100 Subject: [PATCH 36/91] add SecurityAttributeObject --- .../aas4j/v3/model/ProtocolInformation.java | 25 +++- .../v3/model/SecurityAttributeObject.java | 84 ++++++++++++ .../aas4j/v3/model/SecurityTypeEnum.java | 45 +++++++ .../builder/ProtocolInformationBuilder.java | 22 ++++ .../SecurityAttributeObjectBuilder.java | 59 +++++++++ .../impl/DefaultProtocolInformation.java | 22 +++- .../impl/DefaultSecurityAttributeObject.java | 122 ++++++++++++++++++ 7 files changed, 371 insertions(+), 8 deletions(-) create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java index f130166a0..172ed35aa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -15,13 +15,11 @@ package org.eclipse.digitaltwin.aas4j.v3.model; -import java.util.List; - - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; + +import java.util.List; /** @@ -133,4 +131,21 @@ public interface ProtocolInformation { */ void setSubprotocolBodyEncoding(String subprotocolBodyEncoding); + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes + * + * @return Returns the List of SecurityAttributeObjects for the property securityAttributes. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes") + List getSecurityAttributes(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes + * + * @param securityAttributes desired value for the property securityAttributes. + */ + void setSecurityAttributes(List securityAttributes); + } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java new file mode 100644 index 000000000..93a0d62af --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSecurityAttributeObject.class) +}) +public interface SecurityAttributeObject { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/type + * + * @return Returns the SecurityTypeEnum for the property type. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/type") + SecurityTypeEnum getType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/type + * + * @param type desired value for the property type. + */ + void setType(SecurityTypeEnum type); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/key + * + * @return Returns the String for the property key. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/key") + String getKey(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/key + * + * @param key desired value for the property key. + */ + void setKey(String key); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/value") + String getValue(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java new file mode 100644 index 000000000..4276df1ff --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +/** +*/ +@IRI("aas:SecurityTypeEnum") +public enum SecurityTypeEnum { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/None") + NONE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/Rfc_Tlsa") + RFC_TLSA, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/W3c_Did") + W3C_DID; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java index 2e8c53110..4886042b7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -101,4 +101,26 @@ public B subprotocolBodyEncoding(String subprotocolBodyEncoding) { getBuildingInstance().setSubprotocolBodyEncoding(subprotocolBodyEncoding); return getSelf(); } + + /** + * This function allows setting a value for securityAttributes + * + * @param securityAttributes desired value to be set + * @return Builder object with new value for securityAttributes + */ + public B securityAttributes(List securityAttributes) { + getBuildingInstance().setSecurityAttributes(securityAttributes); + return getSelf(); + } + + /** + * This function allows adding a value to the List securityAttributes + * + * @param securityAttributes desired value to be added + * @return Builder object with new value for securityAttributes + */ + public B securityAttributes(SecurityAttributeObject securityAttributes) { + getBuildingInstance().getSecurityAttributes().add(securityAttributes); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java new file mode 100644 index 000000000..138a91e52 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; + + +public abstract class SecurityAttributeObjectBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for type + * + * @param type desired value to be set + * @return Builder object with new value for type + */ + public B type(SecurityTypeEnum type) { + getBuildingInstance().setType(type); + return getSelf(); + } + + /** + * This function allows setting a value for key + * + * @param key desired value to be set + * @return Builder object with new value for key + */ + public B key(String key) { + getBuildingInstance().setKey(key); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java index b4680a749..812981b02 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -42,6 +42,9 @@ public class DefaultProtocolInformation implements ProtocolInformation { @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") protected String href; + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes") + protected List securityAttributes = new ArrayList<>(); + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") protected String subprotocol; @@ -60,7 +63,8 @@ public int hashCode() { this.endpointProtocolVersion, this.subprotocol, this.subprotocolBody, - this.subprotocolBodyEncoding); + this.subprotocolBodyEncoding, + this.securityAttributes); } @Override @@ -78,7 +82,8 @@ public boolean equals(Object obj) { Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && Objects.equals(this.subprotocol, other.subprotocol) && Objects.equals(this.subprotocolBody, other.subprotocolBody) && - Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding); + Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding) && + Objects.equals(this.securityAttributes, other.securityAttributes); } } @@ -142,6 +147,16 @@ public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { this.subprotocolBodyEncoding = subprotocolBodyEncoding; } + @Override + public List getSecurityAttributes() { + return securityAttributes; + } + + @Override + public void setSecurityAttributes(List securityAttributes) { + this.securityAttributes = securityAttributes; + } + public String toString() { return String.format( "DefaultProtocolInformation (" + "href=%s," @@ -150,9 +165,10 @@ public String toString() { + "subprotocol=%s," + "subprotocolBody=%s," + "subprotocolBodyEncoding=%s," + + "securityAttributes=%s," + ")", this.href, this.endpointProtocol, this.endpointProtocolVersion, this.subprotocol, this.subprotocolBody, - this.subprotocolBodyEncoding); + this.subprotocolBodyEncoding, this.securityAttributes); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java new file mode 100644 index 000000000..864d88acc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import java.util.Objects; + + +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.*; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject + * + */ + +@IRI("aas:SecurityAttributeObject") +public class DefaultSecurityAttributeObject implements SecurityAttributeObject { + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/key") + protected String key; + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/type") + protected SecurityTypeEnum type; + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/value") + protected String value; + + public DefaultSecurityAttributeObject() {} + + @Override + public int hashCode() { + return Objects.hash(this.type, + this.key, + this.value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSecurityAttributeObject other = (DefaultSecurityAttributeObject) obj; + return Objects.equals(this.type, other.type) && + Objects.equals(this.key, other.key) && + Objects.equals(this.value, other.value); + } + } + + @Override + public SecurityTypeEnum getType() { + return type; + } + + @Override + public void setType(SecurityTypeEnum type) { + this.type = type; + } + + @Override + public String getKey() { + return key; + } + + @Override + public void setKey(String key) { + this.key = key; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + public String toString() { + return String.format( + "DefaultSecurityAttributeObject (" + "type=%s," + + "key=%s," + + "value=%s," + + ")", + this.type, this.key, this.value); + } + + /** + * This builder class can be used to construct a DefaultSecurityAttributeObject bean. + */ + public static class Builder extends SecurityAttributeObjectBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSecurityAttributeObject newBuildingInstance() { + return new DefaultSecurityAttributeObject(); + } + } +} From a7130e7ed29292b9895a9030517721cc1141176f Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 7 Nov 2023 12:20:24 +0100 Subject: [PATCH 37/91] fix wrong extensions declaration in the submodel json mixin --- .../aas4j/v3/dataformat/json/mixins/SubmodelMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java index d961e94e3..ab0f9faee 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java @@ -42,9 +42,9 @@ public interface SubmodelMixin { @JsonProperty("displayName") public void setDisplayName(List displayName); - @JsonProperty("extension") + @JsonProperty("extensions") List getExtensions(); - @JsonProperty("extension") + @JsonProperty("extensions") void setExtensions(List extensions); } From a843f584896327d868d6b28b9392488cd8754976 Mon Sep 17 00:00:00 2001 From: MS-SAP <66833004+MS-SAP@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:19:10 +0100 Subject: [PATCH 38/91] Remove Roundtrips in JsonSerializer --- .../v3/dataformat/json/JsonSerializer.java | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 651aefeae..97da2f841 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -241,9 +241,7 @@ public String writeReferables(List referables) throws SerializationEx try { ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); - String json = objectWriter.writeValueAsString(referables); - - return mapper.writeValueAsString(this.mapper.readTree(json)); + return objectWriter.writeValueAsString(referables); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing list of Referables", ex); @@ -265,9 +263,7 @@ public String writeReferences(List references) throws SerializationEx try { ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); - String json = objectWriter.writeValueAsString(references); - - return mapper.writeValueAsString(this.mapper.readTree(json)); + return objectWriter.writeValueAsString(references); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing list of References", ex); @@ -290,9 +286,7 @@ public String writeSpecificAssetIds(List specificAssetIds) thro try { ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); - String json = objectWriter.writeValueAsString(specificAssetIds); - - return mapper.writeValueAsString(this.mapper.readTree(json)); + return objectWriter.writeValueAsString(specificAssetIds); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing list of SpecificAssetIds", ex); @@ -316,9 +310,7 @@ public String writeSubmodelDescriptors(List submodelDescript try { ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); - String json = objectWriter.writeValueAsString(submodelDescriptors); - - return mapper.writeValueAsString(this.mapper.readTree(json)); + return objectWriter.writeValueAsString(submodelDescriptors); } catch (JsonProcessingException ex) { throw new SerializationException("error serializing list of SubmodelDescriptors", ex); @@ -342,9 +334,7 @@ public String writeAssetAdministrationShellDescriptors(List Date: Thu, 9 Nov 2023 13:34:06 +0100 Subject: [PATCH 39/91] Remove unused ModelTypeProcessor and JsonTreeProcessor Classes --- .../json/modeltype/JsonTreeProcessor.java | 55 ------------ .../json/modeltype/ModelTypeProcessor.java | 88 ------------------- 2 files changed, 143 deletions(-) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java deleted file mode 100644 index 4463d9a3a..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/JsonTreeProcessor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import java.util.function.Consumer; - -/** - * Helper class to traverse a JsonNode recursive and applying an operation to - * each node - */ -public class JsonTreeProcessor { - - private final Consumer operator; - - public static void traverse(JsonNode node, Consumer operator) { - new JsonTreeProcessor(operator).traverse(node); - } - - public JsonTreeProcessor(Consumer operator) { - this.operator = operator; - } - - public void traverse(JsonNode node) { - if (null == node.getNodeType()) { - return; - } - switch (node.getNodeType()) { - case ARRAY: - node.elements().forEachRemaining(x -> traverse(x)); - break; - case OBJECT: - operator.accept((ObjectNode) node); - node.elements().forEachRemaining(x -> traverse(x)); - break; - default: - // do nothing - } - } -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java deleted file mode 100644 index c07f20bf5..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/modeltype/ModelTypeProcessor.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.modeltype; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; - -/** - * Helper class to deal with nested nature of modelType property in JSON. As - * Jackson can not natively deal with such nested type information, this class - * offers functions to unwrapp the modelType information via the preprocess(...) - * method and wrap it again via postprocess(...). - */ -public class ModelTypeProcessor { - - private static final String MODEL_TYPE = "modelType"; - private static final String MODEL_TYPE_NAME = "name"; - - /** - * Unwrapps type information recursively, e.g. converts - *
-     * "modelType": {
-     *      "name": "Foo"
-     * }
-     * 
to - *
-     * "modelType": "Foo"
-     * 
- * - * @param json json as string - * @return root node with unwrapped type information - * @throws JsonProcessingException parsing JSON fails - */ - public static JsonNode preprocess(String json) throws JsonProcessingException { - JsonNode result = new ObjectMapper().readTree(json); - JsonTreeProcessor.traverse(result, - x -> { - if (x.get(MODEL_TYPE) != null) { - x.replace(MODEL_TYPE, x.get(MODEL_TYPE).get(MODEL_TYPE_NAME)); - } - }); - return result; - } - - /** - * Wraps type information recursively, e.g. converts - *
-     * "modelType": "Foo"
-     * 
to - *
-     * "modelType": {
-     *      "name": "Foo"
-     * }
-     * 
- * - * @param node root node - * @return transformed root node - * @throws JsonProcessingException parsing JSON fails - */ - public static JsonNode postprocess(JsonNode node) throws JsonProcessingException { - JsonTreeProcessor.traverse(node, - x -> { - if (x.get(MODEL_TYPE) != null && x.get(MODEL_TYPE).isTextual()) { - ObjectNode nodeModelType = JsonNodeFactory.instance.objectNode(); - nodeModelType.set(MODEL_TYPE_NAME, JsonNodeFactory.instance.textNode(x.get(MODEL_TYPE).asText())); - x.replace(MODEL_TYPE, nodeModelType); - } - }); - return node; - } -} From db6f08e3b4dd850c74dabe395bcbca0327b5f7aa Mon Sep 17 00:00:00 2001 From: MS-SAP <66833004+MS-SAP@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:21:56 +0100 Subject: [PATCH 40/91] Remove implemented Interfaces from JsonDeserializer --- .../aas4j/v3/dataformat/Deserializer.java | 129 ------------------ ...nistrationShellDescriptorDeserializer.java | 49 ------- .../v3/dataformat/json/JsonDeserializer.java | 10 +- .../json/ReferableDeserializer.java | 81 ----------- .../json/ReferenceDeserializer.java | 52 ------- .../json/SpecificAssetIdDeserializer.java | 52 ------- .../json/SubmodelDescriptorDeserializer.java | 50 ------- 7 files changed, 1 insertion(+), 422 deletions(-) delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java deleted file mode 100644 index b6a4dfa91..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; - -/** - * Generic deserializer interface to deserialize a given string, Outputstream or - * java.io.File into an instance of AssetAdministrationShellEnvironment - */ -public interface Deserializer { - - /** - * Default charset that will be used when no charset is specified - */ - Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - Environment read(String value) throws DeserializationException; - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - default Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - default Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - default Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - default Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ - void useImplementation(Class aasInterface, Class implementation); - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java deleted file mode 100644 index 86fbd42bb..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of AssetAdministrationShellDescriptor - */ -public interface AssetAdministrationShellDescriptorDeserializer { - - /** - * Deserializes a given string into an instance of - * the given AssetAdministrationShellDescriptor - * - * @param assetAdministrationShellDescriptor a string representation of the AssetAdministrationShellDescriptor - * @return an instance of the AssetAdministrationShellDescriptor - * @throws DeserializationException - */ - AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given AssetAdministrationShellDescriptors - * - * @param assetAdministrationShellDescriptors a string representation of an array of AssetAdministrationShellDescriptors - * @return an instance of a list of the AssetAdministrationShellDescriptors - * @throws DeserializationException - */ - List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 752116a65..aa8301b45 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -51,7 +50,7 @@ /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { +public class JsonDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; @@ -386,7 +385,6 @@ public List readReferables(File src, Charset charset, C return readReferables(new FileInputStream(src), charset, outputClass); } - @Override public Reference readReference(String reference) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); @@ -395,7 +393,6 @@ public Reference readReference(String reference) throws DeserializationException } } - @Override public List readReferences(String references) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; @@ -414,7 +411,6 @@ public SpecificAssetId readSpecificAssetId(String specificAssetId) throws Deseri } } - @Override public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; @@ -424,7 +420,6 @@ public List readSpecificAssetIds(String specificAssetIds) throw } } - @Override public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); @@ -433,7 +428,6 @@ public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) thro } } - @Override public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; @@ -443,7 +437,6 @@ public List readSubmodelDescriptors(String submodelDescripto } } - @Override public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); @@ -452,7 +445,6 @@ public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor } } - @Override public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java deleted file mode 100644 index ef6e787a7..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface ReferableDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param referable a string representation of the - * Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException - */ - T readReferable(String referable, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - T readReferable(InputStream src, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param referables a string representation of an - * array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException - */ - List readReferables(String referables, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java deleted file mode 100644 index 87725b376..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface ReferenceDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param reference a string representation of the - * Reference - * @return an instance of the referable - * @throws DeserializationException - */ - Reference readReference(String reference) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param references a string representation of an - * array of References - * @return an instance of a list of the references - * @throws DeserializationException - */ - List readReferences(String references) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java deleted file mode 100644 index e66d66791..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface SpecificAssetIdDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param specificAssetId a string representation of the - * specificAssetId - * @return an instance of the referable - * @throws DeserializationException - */ - SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param specificAssetIds a string representation of an - * array of specificAssetIds - * @return an instance of a list of the referables - * @throws DeserializationException - */ - List readSpecificAssetIds(String specificAssetIds) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java deleted file mode 100644 index d1e7640db..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of SubmodelDescriptor - */ -public interface SubmodelDescriptorDeserializer { - - /** - * Deserializes a given string into an instance of - * the given SubmodelDescriptor - * - * @param submodelDescriptor a string representation of the SubmodelDescriptor - * @return an instance of the SubmodelDescriptor - * @throws DeserializationException - */ - SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given SubmodelDescriptors - * - * @param submodelDescriptors a string representation of an array of SubmodelDescriptors - * @return an instance of a list of the SubmodelDescriptors - * @throws DeserializationException - */ - List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException; - -} From 7d03c07076e2d79e568e30a6e34fcbee90868195 Mon Sep 17 00:00:00 2001 From: MS-SAP <66833004+MS-SAP@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:01:23 +0100 Subject: [PATCH 41/91] Remove Interfaces from JsonDeserializer (#9) --- .../aas4j/v3/dataformat/Deserializer.java | 129 ------------------ ...nistrationShellDescriptorDeserializer.java | 49 ------- .../v3/dataformat/json/JsonDeserializer.java | 10 +- .../json/ReferableDeserializer.java | 81 ----------- .../json/ReferenceDeserializer.java | 52 ------- .../json/SpecificAssetIdDeserializer.java | 52 ------- .../json/SubmodelDescriptorDeserializer.java | 50 ------- 7 files changed, 1 insertion(+), 422 deletions(-) delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java deleted file mode 100644 index b6a4dfa91..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Deserializer.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; - -import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.stream.Collectors; - -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; - -/** - * Generic deserializer interface to deserialize a given string, Outputstream or - * java.io.File into an instance of AssetAdministrationShellEnvironment - */ -public interface Deserializer { - - /** - * Default charset that will be used when no charset is specified - */ - Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - /** - * Deserializes a given string into an instance of - * AssetAdministrationShellEnvironment - * - * @param value a string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - Environment read(String value) throws DeserializationException; - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - default Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - default Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - default Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of - * AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the - * AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - default Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** - * Enables usage of custom implementation to be used for deserialization - * instead of default implementation, e.g. defining a custom implementation - * of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will - * result in all instances of Submodel will be deserialized as - * CustomSubmodel. Subsequent class with the same aasInterface parameter - * will override the effects of all previous calls. - * - * @param the type of the interface to replace - * @param aasInterface the class of the interface to replace - * @param implementation the class implementing the interface that should be - * used for deserialization. - */ - void useImplementation(Class aasInterface, Class implementation); - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java deleted file mode 100644 index 86fbd42bb..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorDeserializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of AssetAdministrationShellDescriptor - */ -public interface AssetAdministrationShellDescriptorDeserializer { - - /** - * Deserializes a given string into an instance of - * the given AssetAdministrationShellDescriptor - * - * @param assetAdministrationShellDescriptor a string representation of the AssetAdministrationShellDescriptor - * @return an instance of the AssetAdministrationShellDescriptor - * @throws DeserializationException - */ - AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given AssetAdministrationShellDescriptors - * - * @param assetAdministrationShellDescriptors a string representation of an array of AssetAdministrationShellDescriptors - * @return an instance of a list of the AssetAdministrationShellDescriptors - * @throws DeserializationException - */ - List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 752116a65..aa8301b45 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -51,7 +50,7 @@ /** * Class for deserializing/parsing AAS JSON documents. */ -public class JsonDeserializer implements Deserializer, ReferableDeserializer, ReferenceDeserializer, SpecificAssetIdDeserializer, SubmodelDescriptorDeserializer, AssetAdministrationShellDescriptorDeserializer { +public class JsonDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; @@ -386,7 +385,6 @@ public List readReferables(File src, Charset charset, C return readReferables(new FileInputStream(src), charset, outputClass); } - @Override public Reference readReference(String reference) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); @@ -395,7 +393,6 @@ public Reference readReference(String reference) throws DeserializationException } } - @Override public List readReferences(String references) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; @@ -414,7 +411,6 @@ public SpecificAssetId readSpecificAssetId(String specificAssetId) throws Deseri } } - @Override public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; @@ -424,7 +420,6 @@ public List readSpecificAssetIds(String specificAssetIds) throw } } - @Override public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); @@ -433,7 +428,6 @@ public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) thro } } - @Override public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; @@ -443,7 +437,6 @@ public List readSubmodelDescriptors(String submodelDescripto } } - @Override public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { try { return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); @@ -452,7 +445,6 @@ public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor } } - @Override public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { try { String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java deleted file mode 100644 index ef6e787a7..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableDeserializer.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface ReferableDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param referable a string representation of the - * Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException - */ - T readReferable(String referable, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - T readReferable(InputStream src, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param referables a string representation of an - * array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException - */ - List readReferables(String referables, Class outputClass) throws DeserializationException; - - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java deleted file mode 100644 index 87725b376..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceDeserializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface ReferenceDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param reference a string representation of the - * Reference - * @return an instance of the referable - * @throws DeserializationException - */ - Reference readReference(String reference) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param references a string representation of an - * array of References - * @return an instance of a list of the references - * @throws DeserializationException - */ - List readReferences(String references) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java deleted file mode 100644 index e66d66791..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdDeserializer.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of referables - */ -public interface SpecificAssetIdDeserializer { - - /** - * Deserializes a given string into an instance of - * the given Referable - * - * @param specificAssetId a string representation of the - * specificAssetId - * @return an instance of the referable - * @throws DeserializationException - */ - SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given Referables - * - * @param specificAssetIds a string representation of an - * array of specificAssetIds - * @return an instance of a list of the referables - * @throws DeserializationException - */ - List readSpecificAssetIds(String specificAssetIds) throws DeserializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java deleted file mode 100644 index d1e7640db..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorDeserializer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.util.List; - -/** - * Deserializer Interface for deserialization of SubmodelDescriptor - */ -public interface SubmodelDescriptorDeserializer { - - /** - * Deserializes a given string into an instance of - * the given SubmodelDescriptor - * - * @param submodelDescriptor a string representation of the SubmodelDescriptor - * @return an instance of the SubmodelDescriptor - * @throws DeserializationException - */ - SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException; - - /** - * Deserializes a given string into an instance of - * a list of the given SubmodelDescriptors - * - * @param submodelDescriptors a string representation of an array of SubmodelDescriptors - * @return an instance of a list of the SubmodelDescriptors - * @throws DeserializationException - */ - List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException; - -} From 337b95242c77b2fcb42c6f0c948fdaf6276bda99 Mon Sep 17 00:00:00 2001 From: MS-SAP <66833004+MS-SAP@users.noreply.github.com> Date: Mon, 20 Nov 2023 02:28:19 +0100 Subject: [PATCH 42/91] Delete all *Value Classes --- .../AnnotatedRelationshipElementValue.java | 85 ----------- .../v3/model/BasicEventElementValue.java | 49 ------ .../digitaltwin/aas4j/v3/model/BlobValue.java | 65 -------- .../aas4j/v3/model/EntityValue.java | 100 ------------- .../digitaltwin/aas4j/v3/model/FileValue.java | 65 -------- .../aas4j/v3/model/NumberValue.java | 30 ---- .../aas4j/v3/model/RangeValue.java | 66 -------- .../aas4j/v3/model/ReferenceElementValue.java | 30 ---- .../aas4j/v3/model/ReferenceValue.java | 50 ------- .../v3/model/RelationshipElementValue.java | 65 -------- .../aas4j/v3/model/StringValue.java | 30 ---- .../v3/model/SubmodelElementListValue.java | 30 ---- ...otatedRelationshipElementValueBuilder.java | 70 --------- .../BasicEventElementValueBuilder.java | 48 ------ .../v3/model/builder/BlobValueBuilder.java | 45 ------ .../v3/model/builder/EntityValueBuilder.java | 92 ------------ .../v3/model/builder/FileValueBuilder.java | 45 ------ .../v3/model/builder/NumberValueBuilder.java | 23 --- .../v3/model/builder/RangeValueBuilder.java | 46 ------ .../builder/ReferenceElementValueBuilder.java | 48 ------ .../model/builder/ReferenceValueBuilder.java | 48 ------ .../RelationshipElementValueBuilder.java | 47 ------ .../v3/model/builder/StringValueBuilder.java | 23 --- .../SubmodelElementListValueBuilder.java | 24 --- ...aultAnnotatedRelationshipElementValue.java | 125 ---------------- .../impl/DefaultBasicEventElementValue.java | 92 ------------ .../aas4j/v3/model/impl/DefaultBlobValue.java | 105 ------------- .../v3/model/impl/DefaultEntityValue.java | 141 ------------------ .../aas4j/v3/model/impl/DefaultFileValue.java | 105 ------------- .../v3/model/impl/DefaultNumberValue.java | 75 ---------- .../v3/model/impl/DefaultRangeValue.java | 106 ------------- .../impl/DefaultReferenceElementValue.java | 93 ------------ .../v3/model/impl/DefaultReferenceValue.java | 92 ------------ .../impl/DefaultRelationshipElementValue.java | 106 ------------- .../v3/model/impl/DefaultStringValue.java | 75 ---------- .../impl/DefaultSubmodelElementListValue.java | 75 ---------- 36 files changed, 2414 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java deleted file mode 100644 index 03b906b94..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementValue.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElementValue; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultAnnotatedRelationshipElementValue.class) -}) -public interface AnnotatedRelationshipElementValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first - * - * @return Returns the ReferenceValue for the property first. - */ - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first") - ReferenceValue getFirst(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first - * - * @param first desired value for the property first. - */ - void setFirst(ReferenceValue first); - - /** - * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second - * - * @return Returns the ReferenceValue for the property second. - */ - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second") - ReferenceValue getSecond(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second - * - * @param second desired value for the property second. - */ - void setSecond(ReferenceValue second); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation - * - * @return Returns the List of Strings for the property annotation. - */ - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation") - List getAnnotation(); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation - * - * @param annotations desired value for the property annotation. - */ - void setAnnotation(List annotations); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java deleted file mode 100644 index cc646cb29..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementValue.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElementValue; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultBasicEventElementValue.class) -}) -public interface BasicEventElementValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementValue/observed - * - * @return Returns the List of ReferenceValues for the property observed. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementValue/observed") - List getObserved(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementValue/observed - * - * @param observeds desired value for the property observed. - */ - void setObserved(List observeds); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java deleted file mode 100644 index a23d6b7b9..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobValue.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlobValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultBlobValue.class) -}) -public interface BlobValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/BlobValue/mimeType - * - * @return Returns the String for the property mimeType. - */ - @IRI("https://admin-shell.io/aas/3/0/BlobValue/mimeType") - String getMimeType(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BlobValue/mimeType - * - * @param mimeType desired value for the property mimeType. - */ - void setMimeType(String mimeType); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BlobValue/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/BlobValue/value") - String getValue(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BlobValue/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java deleted file mode 100644 index 986a99b58..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityValue.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntityValue; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultEntityValue.class) -}) -public interface EntityValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/entityType - * - * @return Returns the EntityType for the property entityType. - */ - @IRI("https://admin-shell.io/aas/3/0/EntityValue/entityType") - EntityType getEntityType(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/entityType - * - * @param entityType desired value for the property entityType. - */ - void setEntityType(EntityType entityType); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/globalAssetId - * - * @return Returns the ReferenceValue for the property globalAssetId. - */ - @IRI("https://admin-shell.io/aas/3/0/EntityValue/globalAssetId") - ReferenceValue getGlobalAssetId(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/globalAssetId - * - * @param globalAssetId desired value for the property globalAssetId. - */ - void setGlobalAssetId(ReferenceValue globalAssetId); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds - * - * @return Returns the List of Strings for the property specificAssetIds. - */ - @IRI("https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds") - List getSpecificAssetIds(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds - * - * @param specificAssetIds desired value for the property specificAssetIds. - */ - void setSpecificAssetIds(List specificAssetIds); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/statements - * - * @return Returns the List of Strings for the property statements. - */ - @IRI("https://admin-shell.io/aas/3/0/EntityValue/statements") - List getStatements(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/EntityValue/statements - * - * @param statements desired value for the property statements. - */ - void setStatements(List statements); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java deleted file mode 100644 index c113db363..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileValue.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFileValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultFileValue.class) -}) -public interface FileValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/FileValue/contentType - * - * @return Returns the String for the property contentType. - */ - @IRI("https://admin-shell.io/aas/3/0/FileValue/contentType") - String getContentType(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/FileValue/contentType - * - * @param contentType desired value for the property contentType. - */ - void setContentType(String contentType); - - /** - * - * More information under https://admin-shell.io/aas/3/0/FileValue/value - * - * @return Returns the String for the property value. - */ - @IRI("https://admin-shell.io/aas/3/0/FileValue/value") - String getValue(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/FileValue/value - * - * @param value desired value for the property value. - */ - void setValue(String value); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java deleted file mode 100644 index d8b1284bb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/NumberValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultNumberValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultNumberValue.class) -}) -public interface NumberValue { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java deleted file mode 100644 index be14c33df..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeValue.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRangeValue; - -import java.math.BigInteger; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultRangeValue.class) -}) -public interface RangeValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeValue/max - * - * @return Returns the BigInteger for the property max. - */ - @IRI("https://admin-shell.io/aas/3/0/RangeValue/max") - BigInteger getMax(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeValue/max - * - * @param max desired value for the property max. - */ - void setMax(BigInteger max); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeValue/min - * - * @return Returns the BigInteger for the property min. - */ - @IRI("https://admin-shell.io/aas/3/0/RangeValue/min") - BigInteger getMin(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeValue/min - * - * @param min desired value for the property min. - */ - void setMin(BigInteger min); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java deleted file mode 100644 index 9115fbd89..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElementValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultReferenceElementValue.class) -}) -public interface ReferenceElementValue extends ReferenceValue { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java deleted file mode 100644 index 5bf67af28..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceValue.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceValue; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultReferenceValue.class), - @KnownSubtypes.Type(value = ReferenceElementValue.class) -}) -public interface ReferenceValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments - * - * @return Returns the List of Keys for the property outputArguments. - */ - @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") - List getOutputArguments(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments - * - * @param outputArguments desired value for the property outputArguments. - */ - void setOutputArguments(List outputArguments); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java deleted file mode 100644 index 817152885..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementValue.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElementValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultRelationshipElementValue.class) -}) -public interface RelationshipElementValue { - - /** - * - * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/first - * - * @return Returns the ReferenceValue for the property first. - */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/first") - ReferenceValue getFirst(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/first - * - * @param first desired value for the property first. - */ - void setFirst(ReferenceValue first); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/second - * - * @return Returns the ReferenceValue for the property second. - */ - @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/second") - ReferenceValue getSecond(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RelationshipElementValue/second - * - * @param second desired value for the property second. - */ - void setSecond(ReferenceValue second); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java deleted file mode 100644 index 9634219a7..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/StringValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultStringValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultStringValue.class) -}) -public interface StringValue { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java deleted file mode 100644 index 115b5a4a1..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementListValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSubmodelElementListValue.class) -}) -public interface SubmodelElementListValue { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java deleted file mode 100644 index 91a2613d3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementValueBuilder.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; - -import java.util.List; - - -public abstract class AnnotatedRelationshipElementValueBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for first - * - * @param first desired value to be set - * @return Builder object with new value for first - */ - public B first(ReferenceValue first) { - getBuildingInstance().setFirst(first); - return getSelf(); - } - - /** - * This function allows setting a value for second - * - * @param second desired value to be set - * @return Builder object with new value for second - */ - public B second(ReferenceValue second) { - getBuildingInstance().setSecond(second); - return getSelf(); - } - - /** - * This function allows setting a value for annotation - * - * @param annotations desired value to be set - * @return Builder object with new value for annotation - */ - public B annotation(List annotations) { - getBuildingInstance().setAnnotation(annotations); - return getSelf(); - } - - /** - * This function allows adding a value to the List annotation - * - * @param annotation desired value to be added - * @return Builder object with new value for annotation - */ - public B annotation(String annotation) { - getBuildingInstance().getAnnotation().add(annotation); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java deleted file mode 100644 index 5ceb4b207..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementValueBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; - -import java.util.List; - - -public abstract class BasicEventElementValueBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for observed - * - * @param observeds desired value to be set - * @return Builder object with new value for observed - */ - public B observed(List observeds) { - getBuildingInstance().setObserved(observeds); - return getSelf(); - } - - /** - * This function allows adding a value to the List observed - * - * @param observed desired value to be added - * @return Builder object with new value for observed - */ - public B observed(ReferenceValue observed) { - getBuildingInstance().getObserved().add(observed); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java deleted file mode 100644 index 9f91675eb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobValueBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.BlobValue; - - -public abstract class BlobValueBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for mimeType - * - * @param mimeType desired value to be set - * @return Builder object with new value for mimeType - */ - public B mimeType(String mimeType) { - getBuildingInstance().setMimeType(mimeType); - return getSelf(); - } - - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java deleted file mode 100644 index 25ff15101..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityValueBuilder.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; - -import java.util.List; - - -public abstract class EntityValueBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for entityType - * - * @param entityType desired value to be set - * @return Builder object with new value for entityType - */ - public B entityType(EntityType entityType) { - getBuildingInstance().setEntityType(entityType); - return getSelf(); - } - - /** - * This function allows setting a value for globalAssetId - * - * @param globalAssetId desired value to be set - * @return Builder object with new value for globalAssetId - */ - public B globalAssetId(ReferenceValue globalAssetId) { - getBuildingInstance().setGlobalAssetId(globalAssetId); - return getSelf(); - } - - /** - * This function allows setting a value for specificAssetIds - * - * @param specificAssetIds desired value to be set - * @return Builder object with new value for specificAssetIds - */ - public B specificAssetIds(List specificAssetIds) { - getBuildingInstance().setSpecificAssetIds(specificAssetIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List specificAssetIds - * - * @param specificAssetIds desired value to be added - * @return Builder object with new value for specificAssetIds - */ - public B specificAssetIds(String specificAssetIds) { - getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); - return getSelf(); - } - - /** - * This function allows setting a value for statements - * - * @param statements desired value to be set - * @return Builder object with new value for statements - */ - public B statements(List statements) { - getBuildingInstance().setStatements(statements); - return getSelf(); - } - - /** - * This function allows adding a value to the List statements - * - * @param statements desired value to be added - * @return Builder object with new value for statements - */ - public B statements(String statements) { - getBuildingInstance().getStatements().add(statements); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java deleted file mode 100644 index 229d35bfa..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileValueBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.FileValue; - - -public abstract class FileValueBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for contentType - * - * @param contentType desired value to be set - * @return Builder object with new value for contentType - */ - public B contentType(String contentType) { - getBuildingInstance().setContentType(contentType); - return getSelf(); - } - - /** - * This function allows setting a value for value - * - * @param value desired value to be set - * @return Builder object with new value for value - */ - public B value(String value) { - getBuildingInstance().setValue(value); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java deleted file mode 100644 index 4a41fc62d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/NumberValueBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.NumberValue; - - -public abstract class NumberValueBuilder> extends ExtendableBuilder { -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java deleted file mode 100644 index dc70e3eda..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeValueBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.RangeValue; - -import java.math.BigInteger; - - -public abstract class RangeValueBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for max - * - * @param max desired value to be set - * @return Builder object with new value for max - */ - public B max(BigInteger max) { - getBuildingInstance().setMax(max); - return getSelf(); - } - - /** - * This function allows setting a value for min - * - * @param min desired value to be set - * @return Builder object with new value for min - */ - public B min(BigInteger min) { - getBuildingInstance().setMin(min); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java deleted file mode 100644 index 22873651b..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementValueBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementValue; - -import java.util.List; - - -public abstract class ReferenceElementValueBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for outputArguments - * - * @param outputArguments desired value to be set - * @return Builder object with new value for outputArguments - */ - public B outputArguments(List outputArguments) { - getBuildingInstance().setOutputArguments(outputArguments); - return getSelf(); - } - - /** - * This function allows adding a value to the List outputArguments - * - * @param outputArguments desired value to be added - * @return Builder object with new value for outputArguments - */ - public B outputArguments(Key outputArguments) { - getBuildingInstance().getOutputArguments().add(outputArguments); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java deleted file mode 100644 index 581e07a7d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceValueBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; - -import java.util.List; - - -public abstract class ReferenceValueBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for outputArguments - * - * @param outputArguments desired value to be set - * @return Builder object with new value for outputArguments - */ - public B outputArguments(List outputArguments) { - getBuildingInstance().setOutputArguments(outputArguments); - return getSelf(); - } - - /** - * This function allows adding a value to the List outputArguments - * - * @param outputArguments desired value to be added - * @return Builder object with new value for outputArguments - */ - public B outputArguments(Key outputArguments) { - getBuildingInstance().getOutputArguments().add(outputArguments); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java deleted file mode 100644 index 8cca3d80c..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementValueBuilder.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementValue; - - -public abstract class RelationshipElementValueBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for first - * - * @param first desired value to be set - * @return Builder object with new value for first - */ - public B first(ReferenceValue first) { - getBuildingInstance().setFirst(first); - return getSelf(); - } - - /** - * This function allows setting a value for second - * - * @param second desired value to be set - * @return Builder object with new value for second - */ - public B second(ReferenceValue second) { - getBuildingInstance().setSecond(second); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java deleted file mode 100644 index 3fdf5953e..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/StringValueBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.StringValue; - - -public abstract class StringValueBuilder> extends ExtendableBuilder { -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java deleted file mode 100644 index 51bc93173..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListValueBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListValue; - - -public abstract class SubmodelElementListValueBuilder> - extends ExtendableBuilder { -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java deleted file mode 100644 index a100a2e28..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementValue.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AnnotatedRelationshipElementValueBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementValue - * - */ - -@IRI("aas:AnnotatedRelationshipElementValue") -public class DefaultAnnotatedRelationshipElementValue implements AnnotatedRelationshipElementValue { - - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/annotation") - protected List annotation = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/first") - protected ReferenceValue first; - - @IRI("https://admin-shell.io/aas/3/0/AnnotatedRelationshipElementValue/second") - protected ReferenceValue second; - - public DefaultAnnotatedRelationshipElementValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.first, - this.second, - this.annotation); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultAnnotatedRelationshipElementValue other = (DefaultAnnotatedRelationshipElementValue) obj; - return Objects.equals(this.first, other.first) && - Objects.equals(this.second, other.second) && - Objects.equals(this.annotation, other.annotation); - } - } - - @Override - public ReferenceValue getFirst() { - return first; - } - - @Override - public void setFirst(ReferenceValue first) { - this.first = first; - } - - @Override - public ReferenceValue getSecond() { - return second; - } - - @Override - public void setSecond(ReferenceValue second) { - this.second = second; - } - - @Override - public List getAnnotation() { - return annotation; - } - - @Override - public void setAnnotation(List annotations) { - this.annotation = annotations; - } - - public String toString() { - return String.format( - "DefaultAnnotatedRelationshipElementValue (" + "first=%s," - + "second=%s," - + "annotation=%s," - + ")", - this.first, this.second, this.annotation); - } - - /** - * This builder class can be used to construct a DefaultAnnotatedRelationshipElementValue bean. - */ - public static class Builder extends AnnotatedRelationshipElementValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultAnnotatedRelationshipElementValue newBuildingInstance() { - return new DefaultAnnotatedRelationshipElementValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java deleted file mode 100644 index d992fc3c1..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementValue.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BasicEventElementValueBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementValue - * - */ - -@IRI("aas:BasicEventElementValue") -public class DefaultBasicEventElementValue implements BasicEventElementValue { - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementValue/observed") - protected List observed = new ArrayList<>(); - - public DefaultBasicEventElementValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.observed); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultBasicEventElementValue other = (DefaultBasicEventElementValue) obj; - return Objects.equals(this.observed, other.observed); - } - } - - @Override - public List getObserved() { - return observed; - } - - @Override - public void setObserved(List observeds) { - this.observed = observeds; - } - - public String toString() { - return String.format( - "DefaultBasicEventElementValue (" + "observed=%s," - + ")", - this.observed); - } - - /** - * This builder class can be used to construct a DefaultBasicEventElementValue bean. - */ - public static class Builder extends BasicEventElementValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultBasicEventElementValue newBuildingInstance() { - return new DefaultBasicEventElementValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java deleted file mode 100644 index 74e084fe6..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobValue.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.BlobValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BlobValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BlobValue - * - */ - -@IRI("aas:BlobValue") -public class DefaultBlobValue implements BlobValue { - - @IRI("https://admin-shell.io/aas/3/0/BlobValue/mimeType") - protected String mimeType; - - @IRI("https://admin-shell.io/aas/3/0/BlobValue/value") - protected String value; - - public DefaultBlobValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.mimeType, - this.value); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultBlobValue other = (DefaultBlobValue) obj; - return Objects.equals(this.mimeType, other.mimeType) && - Objects.equals(this.value, other.value); - } - } - - @Override - public String getMimeType() { - return mimeType; - } - - @Override - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - public String toString() { - return String.format( - "DefaultBlobValue (" + "mimeType=%s," - + "value=%s," - + ")", - this.mimeType, this.value); - } - - /** - * This builder class can be used to construct a DefaultBlobValue bean. - */ - public static class Builder extends BlobValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultBlobValue newBuildingInstance() { - return new DefaultBlobValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java deleted file mode 100644 index 3f1e0c357..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityValue.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityValue; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EntityValueBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.EntityValue - * - */ - -@IRI("aas:EntityValue") -public class DefaultEntityValue implements EntityValue { - - @IRI("https://admin-shell.io/aas/3/0/EntityValue/entityType") - protected EntityType entityType; - - @IRI("https://admin-shell.io/aas/3/0/EntityValue/globalAssetId") - protected ReferenceValue globalAssetId; - - @IRI("https://admin-shell.io/aas/3/0/EntityValue/specificAssetIds") - protected List specificAssetIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/EntityValue/statements") - protected List statements = new ArrayList<>(); - - public DefaultEntityValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.entityType, - this.globalAssetId, - this.specificAssetIds, - this.statements); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultEntityValue other = (DefaultEntityValue) obj; - return Objects.equals(this.entityType, other.entityType) && - Objects.equals(this.globalAssetId, other.globalAssetId) && - Objects.equals(this.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.statements, other.statements); - } - } - - @Override - public EntityType getEntityType() { - return entityType; - } - - @Override - public void setEntityType(EntityType entityType) { - this.entityType = entityType; - } - - @Override - public ReferenceValue getGlobalAssetId() { - return globalAssetId; - } - - @Override - public void setGlobalAssetId(ReferenceValue globalAssetId) { - this.globalAssetId = globalAssetId; - } - - @Override - public List getSpecificAssetIds() { - return specificAssetIds; - } - - @Override - public void setSpecificAssetIds(List specificAssetIds) { - this.specificAssetIds = specificAssetIds; - } - - @Override - public List getStatements() { - return statements; - } - - @Override - public void setStatements(List statements) { - this.statements = statements; - } - - public String toString() { - return String.format( - "DefaultEntityValue (" + "entityType=%s," - + "globalAssetId=%s," - + "specificAssetIds=%s," - + "statements=%s," - + ")", - this.entityType, this.globalAssetId, this.specificAssetIds, this.statements); - } - - /** - * This builder class can be used to construct a DefaultEntityValue bean. - */ - public static class Builder extends EntityValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultEntityValue newBuildingInstance() { - return new DefaultEntityValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java deleted file mode 100644 index 88f9346fc..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileValue.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.FileValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.FileValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.FileValue - * - */ - -@IRI("aas:FileValue") -public class DefaultFileValue implements FileValue { - - @IRI("https://admin-shell.io/aas/3/0/FileValue/contentType") - protected String contentType; - - @IRI("https://admin-shell.io/aas/3/0/FileValue/value") - protected String value; - - public DefaultFileValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.contentType, - this.value); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultFileValue other = (DefaultFileValue) obj; - return Objects.equals(this.contentType, other.contentType) && - Objects.equals(this.value, other.value); - } - } - - @Override - public String getContentType() { - return contentType; - } - - @Override - public void setContentType(String contentType) { - this.contentType = contentType; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void setValue(String value) { - this.value = value; - } - - public String toString() { - return String.format( - "DefaultFileValue (" + "contentType=%s," - + "value=%s," - + ")", - this.contentType, this.value); - } - - /** - * This builder class can be used to construct a DefaultFileValue bean. - */ - public static class Builder extends FileValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultFileValue newBuildingInstance() { - return new DefaultFileValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java deleted file mode 100644 index 1edef8f02..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultNumberValue.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.NumberValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.NumberValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.NumberValue - * - */ - -@IRI("aas:NumberValue") -public class DefaultNumberValue implements NumberValue { - - public DefaultNumberValue() {} - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } - return true; - } - - public String toString() { - return String.format( - "DefaultNumberValue (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultNumberValue bean. - */ - public static class Builder extends NumberValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultNumberValue newBuildingInstance() { - return new DefaultNumberValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java deleted file mode 100644 index e9176b720..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeValue.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.RangeValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RangeValueBuilder; - -import java.math.BigInteger; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RangeValue - * - */ - -@IRI("aas:RangeValue") -public class DefaultRangeValue implements RangeValue { - - @IRI("https://admin-shell.io/aas/3/0/RangeValue/max") - protected BigInteger max; - - @IRI("https://admin-shell.io/aas/3/0/RangeValue/min") - protected BigInteger min; - - public DefaultRangeValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.max, - this.min); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultRangeValue other = (DefaultRangeValue) obj; - return Objects.equals(this.max, other.max) && - Objects.equals(this.min, other.min); - } - } - - @Override - public BigInteger getMax() { - return max; - } - - @Override - public void setMax(BigInteger max) { - this.max = max; - } - - @Override - public BigInteger getMin() { - return min; - } - - @Override - public void setMin(BigInteger min) { - this.min = min; - } - - public String toString() { - return String.format( - "DefaultRangeValue (" + "max=%s," - + "min=%s," - + ")", - this.max, this.min); - } - - /** - * This builder class can be used to construct a DefaultRangeValue bean. - */ - public static class Builder extends RangeValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultRangeValue newBuildingInstance() { - return new DefaultRangeValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java deleted file mode 100644 index 734a89f03..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementValue.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ReferenceElementValueBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementValue - * - */ - -@IRI("aas:ReferenceElementValue") -public class DefaultReferenceElementValue implements ReferenceElementValue { - - @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") - protected List outputArguments = new ArrayList<>(); - - public DefaultReferenceElementValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.outputArguments); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultReferenceElementValue other = (DefaultReferenceElementValue) obj; - return Objects.equals(this.outputArguments, other.outputArguments); - } - } - - @Override - public List getOutputArguments() { - return outputArguments; - } - - @Override - public void setOutputArguments(List outputArguments) { - this.outputArguments = outputArguments; - } - - public String toString() { - return String.format( - "DefaultReferenceElementValue (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultReferenceElementValue bean. - */ - public static class Builder extends ReferenceElementValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultReferenceElementValue newBuildingInstance() { - return new DefaultReferenceElementValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java deleted file mode 100644 index 5c46ecb1b..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceValue.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ReferenceValueBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue - * - */ - -@IRI("aas:ReferenceValue") -public class DefaultReferenceValue implements ReferenceValue { - - @IRI("https://admin-shell.io/aas/3/0/ReferenceValue/outputArguments") - protected List outputArguments = new ArrayList<>(); - - public DefaultReferenceValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.outputArguments); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultReferenceValue other = (DefaultReferenceValue) obj; - return Objects.equals(this.outputArguments, other.outputArguments); - } - } - - @Override - public List getOutputArguments() { - return outputArguments; - } - - @Override - public void setOutputArguments(List outputArguments) { - this.outputArguments = outputArguments; - } - - public String toString() { - return String.format( - "DefaultReferenceValue (" + "outputArguments=%s," - + ")", - this.outputArguments); - } - - /** - * This builder class can be used to construct a DefaultReferenceValue bean. - */ - public static class Builder extends ReferenceValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultReferenceValue newBuildingInstance() { - return new DefaultReferenceValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java deleted file mode 100644 index a9a24aa16..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementValue.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceValue; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RelationshipElementValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementValue - * - */ - -@IRI("aas:RelationshipElementValue") -public class DefaultRelationshipElementValue implements RelationshipElementValue { - - @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/first") - protected ReferenceValue first; - - @IRI("https://admin-shell.io/aas/3/0/RelationshipElementValue/second") - protected ReferenceValue second; - - public DefaultRelationshipElementValue() {} - - @Override - public int hashCode() { - return Objects.hash(this.first, - this.second); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultRelationshipElementValue other = (DefaultRelationshipElementValue) obj; - return Objects.equals(this.first, other.first) && - Objects.equals(this.second, other.second); - } - } - - @Override - public ReferenceValue getFirst() { - return first; - } - - @Override - public void setFirst(ReferenceValue first) { - this.first = first; - } - - @Override - public ReferenceValue getSecond() { - return second; - } - - @Override - public void setSecond(ReferenceValue second) { - this.second = second; - } - - public String toString() { - return String.format( - "DefaultRelationshipElementValue (" + "first=%s," - + "second=%s," - + ")", - this.first, this.second); - } - - /** - * This builder class can be used to construct a DefaultRelationshipElementValue bean. - */ - public static class Builder extends RelationshipElementValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultRelationshipElementValue newBuildingInstance() { - return new DefaultRelationshipElementValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java deleted file mode 100644 index 4bc8767e7..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultStringValue.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.StringValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.StringValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.StringValue - * - */ - -@IRI("aas:StringValue") -public class DefaultStringValue implements StringValue { - - public DefaultStringValue() {} - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } - return true; - } - - public String toString() { - return String.format( - "DefaultStringValue (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultStringValue bean. - */ - public static class Builder extends StringValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultStringValue newBuildingInstance() { - return new DefaultStringValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java deleted file mode 100644 index dcb75f7a8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListValue.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementListValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListValue - * - */ - -@IRI("aas:SubmodelElementListValue") -public class DefaultSubmodelElementListValue implements SubmodelElementListValue { - - public DefaultSubmodelElementListValue() {} - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } - return true; - } - - public String toString() { - return String.format( - "DefaultSubmodelElementListValue (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultSubmodelElementListValue bean. - */ - public static class Builder extends SubmodelElementListValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSubmodelElementListValue newBuildingInstance() { - return new DefaultSubmodelElementListValue(); - } - } -} From ae14b87ad3783e9b9efe015dee3f9dbfb1b89cdc Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 21 Nov 2023 17:30:26 +0100 Subject: [PATCH 43/91] rerun of the generator but without the *Value classes --- .../aas4j/v3/dataformat/core/Examples.java | 1 + .../aas4j/v3/model/AbstractLangString.java | 6 +- .../aas4j/v3/model/DataElement.java | 2 + .../aas4j/v3/model/FileMetadata.java | 30 --- .../aas4j/v3/model/HasSemantics.java | 4 +- .../v3/model/MultiLanguagePropertyValue.java | 30 --- .../v3/model/OperationRequestValueOnly.java | 100 -------- .../v3/model/OperationResultValueOnly.java | 117 --------- .../digitaltwin/aas4j/v3/model/Referable.java | 5 +- .../v3/model/RelationshipElementMetadata.java | 30 --- .../digitaltwin/aas4j/v3/model/Submodel.java | 2 +- .../aas4j/v3/model/SubmodelElement.java | 2 +- .../v3/model/SubmodelElementAttributes.java | 2 - .../AnnotatedRelationshipElementBuilder.java | 110 ++++---- .../builder/BasicEventElementBuilder.java | 110 ++++---- .../aas4j/v3/model/builder/BlobBuilder.java | 110 ++++---- .../v3/model/builder/CapabilityBuilder.java | 110 ++++---- .../builder/ConceptDescriptionBuilder.java | 44 ++-- .../aas4j/v3/model/builder/EntityBuilder.java | 110 ++++---- .../aas4j/v3/model/builder/FileBuilder.java | 110 ++++---- .../v3/model/builder/FileMetadataBuilder.java | 207 --------------- .../builder/MultiLanguagePropertyBuilder.java | 110 ++++---- .../MultiLanguagePropertyValueBuilder.java | 24 -- .../v3/model/builder/OperationBuilder.java | 110 ++++---- .../OperationRequestValueOnlyBuilder.java | 69 ----- .../OperationResultValueOnlyBuilder.java | 137 ---------- .../v3/model/builder/PropertyBuilder.java | 110 ++++---- .../aas4j/v3/model/builder/RangeBuilder.java | 110 ++++---- .../builder/ReferenceElementBuilder.java | 142 +++++------ .../builder/RelationshipElementBuilder.java | 110 ++++---- .../RelationshipElementMetadataBuilder.java | 208 ---------------- .../v3/model/builder/SubmodelBuilder.java | 132 +++++----- .../SubmodelElementCollectionBuilder.java | 110 ++++---- .../builder/SubmodelElementListBuilder.java | 110 ++++---- .../DefaultAnnotatedRelationshipElement.java | 76 +++--- .../impl/DefaultAssetAdministrationShell.java | 28 +-- .../model/impl/DefaultBasicEventElement.java | 76 +++--- .../aas4j/v3/model/impl/DefaultBlob.java | 78 +++--- .../v3/model/impl/DefaultCapability.java | 76 +++--- .../model/impl/DefaultConceptDescription.java | 28 +-- .../aas4j/v3/model/impl/DefaultEntity.java | 76 +++--- .../aas4j/v3/model/impl/DefaultExtension.java | 4 +- .../aas4j/v3/model/impl/DefaultFile.java | 76 +++--- .../v3/model/impl/DefaultFileMetadata.java | 234 ----------------- .../impl/DefaultMultiLanguageProperty.java | 76 +++--- .../DefaultMultiLanguagePropertyValue.java | 76 ------ .../aas4j/v3/model/impl/DefaultOperation.java | 76 +++--- .../DefaultOperationRequestValueOnly.java | 139 ----------- .../impl/DefaultOperationResultValueOnly.java | 157 ------------ .../aas4j/v3/model/impl/DefaultProperty.java | 76 +++--- .../aas4j/v3/model/impl/DefaultRange.java | 76 +++--- .../model/impl/DefaultReferenceElement.java | 76 +++--- .../impl/DefaultRelationshipElement.java | 76 +++--- .../DefaultRelationshipElementMetadata.java | 235 ------------------ .../DefaultSubmodelElementCollection.java | 76 +++--- 55 files changed, 1412 insertions(+), 3203 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index d8bc3ef3b..281a2736e 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -34,6 +34,7 @@ public class Examples { .id("something_142922d6") .extensions(new DefaultExtension.Builder() .name("something_aae6caf4") + .valueType(DataTypeDefXsd.STRING) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.NOT_APPLICABLE) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index 80d41621f..52fd7fd57 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -24,11 +24,11 @@ * Strings with language tags */ @KnownSubtypes({ + @KnownSubtypes.Type(value = LangStringTextType.class), + @KnownSubtypes.Type(value = LangStringNameType.class), @KnownSubtypes.Type(value = LangStringPreferredNameTypeIec61360.class), @KnownSubtypes.Type(value = LangStringShortNameTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringNameType.class), - @KnownSubtypes.Type(value = LangStringTextType.class) + @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class) }) public interface AbstractLangString { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index d2cfd8bf7..fe56cb02e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -15,8 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; + /** * A data element is a submodel element that is not further composed out of other submodel elements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java deleted file mode 100644 index 42e7563c2..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/FileMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFileMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultFileMetadata.class) -}) -public interface FileMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 41f9b9978..36c9c4e39 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -26,9 +26,11 @@ */ @KnownSubtypes({ @KnownSubtypes.Type(value = SpecificAssetId.class), + @KnownSubtypes.Type(value = Extension.class), + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), - @KnownSubtypes.Type(value = Extension.class), @KnownSubtypes.Type(value = Qualifier.class) }) public interface HasSemantics { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java deleted file mode 100644 index 571fd1feb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyValue.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguagePropertyValue; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultMultiLanguagePropertyValue.class) -}) -public interface MultiLanguagePropertyValue { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java deleted file mode 100644 index 292d9dfd7..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequestValueOnly.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequestValueOnly; - -import java.math.BigInteger; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultOperationRequestValueOnly.class) -}) -public interface OperationRequestValueOnly { - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments - * - * @return Returns the String for the property inoutputArguments. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments") - String getInoutputArguments(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments - * - * @param inoutputArguments desired value for the property inoutputArguments. - */ - void setInoutputArguments(String inoutputArguments); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments - * - * @return Returns the String for the property inputArguments. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments") - String getInputArguments(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments - * - * @param inputArguments desired value for the property inputArguments. - */ - void setInputArguments(String inputArguments); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId - * - * @return Returns the String for the property requestId. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId") - String getRequestId(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId - * - * @param requestId desired value for the property requestId. - */ - void setRequestId(String requestId); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout - * - * @return Returns the BigInteger for the property timeout. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout") - BigInteger getTimeout(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout - * - * @param timeout desired value for the property timeout. - */ - void setTimeout(BigInteger timeout); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java deleted file mode 100644 index b4f06e7e8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResultValueOnly.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationResultValueOnly; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultOperationResultValueOnly.class) -}) -public interface OperationResultValueOnly { - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult - * - * @return Returns the List of Results for the property executionResult. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult") - List getExecutionResult(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult - * - * @param executionResults desired value for the property executionResult. - */ - void setExecutionResult(List executionResults); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState - * - * @return Returns the List of ExecutionStates for the property executionState. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState") - List getExecutionState(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState - * - * @param executionStates desired value for the property executionState. - */ - void setExecutionState(List executionStates); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments - * - * @return Returns the List of Strings for the property inoutputArguments. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments") - List getInoutputArguments(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments - * - * @param inoutputArguments desired value for the property inoutputArguments. - */ - void setInoutputArguments(List inoutputArguments); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments - * - * @return Returns the List of Strings for the property outputArguments. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments") - List getOutputArguments(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments - * - * @param outputArguments desired value for the property outputArguments. - */ - void setOutputArguments(List outputArguments); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId - * - * @return Returns the List of Strings for the property requestId. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId") - List getRequestId(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId - * - * @param requestIds desired value for the property requestId. - */ - void setRequestId(List requestIds); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 71c5e6ad8..4f2dc3d08 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -25,8 +25,9 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), - @KnownSubtypes.Type(value = Identifiable.class) + @KnownSubtypes.Type(value = SubmodelElementAttributes.class), + @KnownSubtypes.Type(value = Identifiable.class), + @KnownSubtypes.Type(value = SubmodelElement.class) }) public interface Referable extends HasExtensions { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java deleted file mode 100644 index bb8d60cdd..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RelationshipElementMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRelationshipElementMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultRelationshipElementMetadata.class) -}) -public interface RelationshipElementMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 4e8fd3266..1c5e731a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -28,7 +28,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { +public interface Submodel extends Identifiable, HasDataSpecification, HasSemantics, Qualifiable, HasKind { /** * A submodel consists of zero or more submodel elements. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index afb2299d6..a10fffd2c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -32,6 +32,6 @@ @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { +public interface SubmodelElement extends HasDataSpecification, Referable, HasSemantics, Qualifiable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java index cd7a749d9..354d5aa53 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java @@ -30,13 +30,11 @@ @KnownSubtypes.Type(value = BlobMetadata.class), @KnownSubtypes.Type(value = CapabilityMetadata.class), @KnownSubtypes.Type(value = EntityMetadata.class), - @KnownSubtypes.Type(value = FileMetadata.class), @KnownSubtypes.Type(value = MultiLanguagePropertyMetadata.class), @KnownSubtypes.Type(value = OperationMetadata.class), @KnownSubtypes.Type(value = PropertyMetadata.class), @KnownSubtypes.Type(value = RangeMetadata.class), @KnownSubtypes.Type(value = ReferenceElementMetadata.class), - @KnownSubtypes.Type(value = RelationshipElementMetadata.class), @KnownSubtypes.Type(value = SubmodelElementListMetadata.class), @KnownSubtypes.Type(value = SubmodelElementCollectionMetadata.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 0a3067f18..053a5469d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -96,61 +96,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -238,4 +183,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 181f1199a..23d2f52c3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -141,61 +141,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -283,4 +228,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index 7859c310e..aaf6f193a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -72,61 +72,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -214,4 +159,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 548d57037..2cea916a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -50,61 +50,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -192,4 +137,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 57919df59..68793dda9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -51,28 +51,6 @@ public B isCaseOf(Reference isCaseOf) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -182,4 +160,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 98511ba99..0571300fa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -119,61 +119,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -261,4 +206,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index ff1eacc8b..675181358 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -72,61 +72,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -214,4 +159,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java deleted file mode 100644 index 97f1d14bf..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileMetadataBuilder.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.FileMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class FileMetadataBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 85f30d76a..88263ea0f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java deleted file mode 100644 index b3c16f5d1..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyValueBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - - -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyValue; - - -public abstract class MultiLanguagePropertyValueBuilder> - extends ExtendableBuilder { -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index f7d0a63a9..3bdee33de 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -117,61 +117,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -259,4 +204,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java deleted file mode 100644 index c8e960520..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestValueOnlyBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequestValueOnly; - -import java.math.BigInteger; - - -public abstract class OperationRequestValueOnlyBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for inoutputArguments - * - * @param inoutputArguments desired value to be set - * @return Builder object with new value for inoutputArguments - */ - public B inoutputArguments(String inoutputArguments) { - getBuildingInstance().setInoutputArguments(inoutputArguments); - return getSelf(); - } - - /** - * This function allows setting a value for inputArguments - * - * @param inputArguments desired value to be set - * @return Builder object with new value for inputArguments - */ - public B inputArguments(String inputArguments) { - getBuildingInstance().setInputArguments(inputArguments); - return getSelf(); - } - - /** - * This function allows setting a value for requestId - * - * @param requestId desired value to be set - * @return Builder object with new value for requestId - */ - public B requestId(String requestId) { - getBuildingInstance().setRequestId(requestId); - return getSelf(); - } - - /** - * This function allows setting a value for timeout - * - * @param timeout desired value to be set - * @return Builder object with new value for timeout - */ - public B timeout(BigInteger timeout) { - getBuildingInstance().setTimeout(timeout); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java deleted file mode 100644 index 5c2a99343..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultValueOnlyBuilder.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationResultValueOnly; -import org.eclipse.digitaltwin.aas4j.v3.model.Result; - -import java.util.List; - - -public abstract class OperationResultValueOnlyBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for executionResult - * - * @param executionResults desired value to be set - * @return Builder object with new value for executionResult - */ - public B executionResult(List executionResults) { - getBuildingInstance().setExecutionResult(executionResults); - return getSelf(); - } - - /** - * This function allows adding a value to the List executionResult - * - * @param executionResult desired value to be added - * @return Builder object with new value for executionResult - */ - public B executionResult(Result executionResult) { - getBuildingInstance().getExecutionResult().add(executionResult); - return getSelf(); - } - - /** - * This function allows setting a value for executionState - * - * @param executionStates desired value to be set - * @return Builder object with new value for executionState - */ - public B executionState(List executionStates) { - getBuildingInstance().setExecutionState(executionStates); - return getSelf(); - } - - /** - * This function allows adding a value to the List executionState - * - * @param executionState desired value to be added - * @return Builder object with new value for executionState - */ - public B executionState(ExecutionState executionState) { - getBuildingInstance().getExecutionState().add(executionState); - return getSelf(); - } - - /** - * This function allows setting a value for inoutputArguments - * - * @param inoutputArguments desired value to be set - * @return Builder object with new value for inoutputArguments - */ - public B inoutputArguments(List inoutputArguments) { - getBuildingInstance().setInoutputArguments(inoutputArguments); - return getSelf(); - } - - /** - * This function allows adding a value to the List inoutputArguments - * - * @param inoutputArguments desired value to be added - * @return Builder object with new value for inoutputArguments - */ - public B inoutputArguments(String inoutputArguments) { - getBuildingInstance().getInoutputArguments().add(inoutputArguments); - return getSelf(); - } - - /** - * This function allows setting a value for outputArguments - * - * @param outputArguments desired value to be set - * @return Builder object with new value for outputArguments - */ - public B outputArguments(List outputArguments) { - getBuildingInstance().setOutputArguments(outputArguments); - return getSelf(); - } - - /** - * This function allows adding a value to the List outputArguments - * - * @param outputArguments desired value to be added - * @return Builder object with new value for outputArguments - */ - public B outputArguments(String outputArguments) { - getBuildingInstance().getOutputArguments().add(outputArguments); - return getSelf(); - } - - /** - * This function allows setting a value for requestId - * - * @param requestIds desired value to be set - * @return Builder object with new value for requestId - */ - public B requestId(List requestIds) { - getBuildingInstance().setRequestId(requestIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List requestId - * - * @param requestId desired value to be added - * @return Builder object with new value for requestId - */ - public B requestId(String requestId) { - getBuildingInstance().getRequestId().add(requestId); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index dc6fd05b1..341655cd5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index e6bf48fc8..154ab006a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 4b12ca31b..6cdf40435 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -1,12 +1,12 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (c) 2023, SAP SE or an SAP affiliate company - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under @@ -27,11 +27,11 @@ public abstract class ReferenceElementBuilder> - extends ExtendableBuilder { + extends ExtendableBuilder { /** * This function allows setting a value for value - * + * * @param value desired value to be set * @return Builder object with new value for value */ @@ -42,7 +42,7 @@ public B value(Reference value) { /** * This function allows setting a value for embeddedDataSpecifications - * + * * @param embeddedDataSpecifications desired value to be set * @return Builder object with new value for embeddedDataSpecifications */ @@ -53,7 +53,7 @@ public B embeddedDataSpecifications(List embeddedData /** * This function allows adding a value to the List embeddedDataSpecifications - * + * * @param embeddedDataSpecifications desired value to be added * @return Builder object with new value for embeddedDataSpecifications */ @@ -62,64 +62,9 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category - * + * * @param category desired value to be set * @return Builder object with new value for category */ @@ -130,7 +75,7 @@ public B category(String category) { /** * This function allows setting a value for idShort - * + * * @param idShort desired value to be set * @return Builder object with new value for idShort */ @@ -141,7 +86,7 @@ public B idShort(String idShort) { /** * This function allows setting a value for displayName - * + * * @param displayNames desired value to be set * @return Builder object with new value for displayName */ @@ -152,7 +97,7 @@ public B displayName(List displayNames) { /** * This function allows adding a value to the List displayName - * + * * @param displayName desired value to be added * @return Builder object with new value for displayName */ @@ -163,7 +108,7 @@ public B displayName(LangStringNameType displayName) { /** * This function allows setting a value for description - * + * * @param descriptions desired value to be set * @return Builder object with new value for description */ @@ -174,7 +119,7 @@ public B description(List descriptions) { /** * This function allows adding a value to the List description - * + * * @param description desired value to be added * @return Builder object with new value for description */ @@ -185,7 +130,7 @@ public B description(LangStringTextType description) { /** * This function allows setting a value for extensions - * + * * @param extensions desired value to be set * @return Builder object with new value for extensions */ @@ -196,7 +141,7 @@ public B extensions(List extensions) { /** * This function allows adding a value to the List extensions - * + * * @param extensions desired value to be added * @return Builder object with new value for extensions */ @@ -204,4 +149,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } -} \ No newline at end of file + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 081547980..01c1d2815 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -73,61 +73,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -215,4 +160,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java deleted file mode 100644 index 92116083d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementMetadata; - -import java.util.List; - - -public abstract class RelationshipElementMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index c3c970250..0546305c9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -53,72 +53,6 @@ public B submodelElements(SubmodelElement submodelElements) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -229,6 +163,61 @@ public B extensions(Extension extensions) { return getSelf(); } + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + /** * This function allows setting a value for qualifiers * @@ -250,4 +239,15 @@ public B qualifiers(Qualifier qualifiers) { getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index e1c8e980c..afa1350bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -74,61 +74,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -216,4 +161,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index f50442fee..734351772 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -120,61 +120,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -262,4 +207,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 6ae2c1d6a..1f771a2d1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -86,14 +86,14 @@ public int hashCode() { this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -110,14 +110,14 @@ public boolean equals(Object obj) { Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -161,36 +161,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -241,6 +211,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultAnnotatedRelationshipElement (" + "annotations=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 7fc97b452..755ef9896 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -80,14 +80,14 @@ public int hashCode() { return Objects.hash(this.derivedFrom, this.assetInformation, this.submodels, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -103,14 +103,14 @@ public boolean equals(Object obj) { return Objects.equals(this.derivedFrom, other.derivedFrom) && Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -144,16 +144,6 @@ public void setSubmodels(List submodels) { this.submodels = submodels; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -224,6 +214,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultAssetAdministrationShell (" + "derivedFrom=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 0763b8ba6..c7fbf209c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -105,14 +105,14 @@ public int hashCode() { this.minInterval, this.maxInterval, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -134,14 +134,14 @@ public boolean equals(Object obj) { Objects.equals(this.minInterval, other.minInterval) && Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -235,36 +235,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -315,6 +285,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBasicEventElement (" + "observed=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index ebf7e4ca4..76bc9271f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -81,14 +81,14 @@ public int hashCode() { return Objects.hash(Arrays.hashCode(this.value), this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -104,14 +104,14 @@ public boolean equals(Object obj) { return Arrays.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -145,36 +145,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -225,12 +195,42 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBlob (" + "value=%s," + "contentType=%s," + ")", - Arrays.toString(this.value), this.contentType); + this.value, this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index d4167b66a..4f249157c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -72,14 +72,14 @@ public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -93,14 +93,14 @@ public boolean equals(Object obj) { } else { DefaultCapability other = (DefaultCapability) obj; return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -114,36 +114,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -194,6 +164,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultCapability (" diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 51ad68c22..0e7d03eb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -72,14 +72,14 @@ public DefaultConceptDescription() {} @Override public int hashCode() { return Objects.hash(this.isCaseOf, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -93,14 +93,14 @@ public boolean equals(Object obj) { } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; return Objects.equals(this.isCaseOf, other.isCaseOf) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -114,16 +114,6 @@ public void setIsCaseOf(List isCaseOfs) { this.isCaseOf = isCaseOfs; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -194,6 +184,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultConceptDescription (" + "isCaseOf=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index e39c60717..9df1c5a11 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -90,14 +90,14 @@ public int hashCode() { this.globalAssetId, this.specificAssetIds, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -115,14 +115,14 @@ public boolean equals(Object obj) { Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -176,36 +176,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -256,6 +226,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultEntity (" + "statements=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index cc7957958..eb013ed1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -53,9 +53,7 @@ public class DefaultExtension implements Extension { @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - this.valueType = DataTypeDefXsd.STRING; - } + public DefaultExtension() {} @Override public int hashCode() { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 5540d1eb0..0b0251441 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -79,14 +79,14 @@ public int hashCode() { return Objects.hash(this.value, this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -102,14 +102,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -143,36 +143,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -223,6 +193,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultFile (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java deleted file mode 100644 index 69ca4531e..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFileMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.FileMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.FileMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.FileMetadata - * - */ - -@IRI("aas:FileMetadata") -public class DefaultFileMetadata implements FileMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultFileMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultFileMetadata other = (DefaultFileMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultFileMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultFileMetadata bean. - */ - public static class Builder extends FileMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultFileMetadata newBuildingInstance() { - return new DefaultFileMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 2c0de4f5f..651b3beb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -79,14 +79,14 @@ public int hashCode() { return Objects.hash(this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -102,14 +102,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -143,36 +143,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -223,6 +193,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultMultiLanguageProperty (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java deleted file mode 100644 index 208cb43b2..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyValue.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyValue; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.MultiLanguagePropertyValueBuilder; - -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyValue - * - */ - -@IRI("aas:MultiLanguagePropertyValue") -public class DefaultMultiLanguagePropertyValue implements MultiLanguagePropertyValue { - - public DefaultMultiLanguagePropertyValue() {} - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } - return true; - } - - public String toString() { - return String.format( - "DefaultMultiLanguagePropertyValue (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultMultiLanguagePropertyValue bean. - */ - public static class Builder extends MultiLanguagePropertyValueBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultMultiLanguagePropertyValue newBuildingInstance() { - return new DefaultMultiLanguagePropertyValue(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index ff6d65c2e..5615c9158 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -84,14 +84,14 @@ public int hashCode() { this.outputVariables, this.inoutputVariables, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.outputVariables, other.outputVariables) && Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultOperation (" + "inputVariables=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java deleted file mode 100644 index a3922f82e..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequestValueOnly.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequestValueOnly; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationRequestValueOnlyBuilder; - -import java.math.BigInteger; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.OperationRequestValueOnly - * - */ - -@IRI("aas:OperationRequestValueOnly") -public class DefaultOperationRequestValueOnly implements OperationRequestValueOnly { - - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inoutputArguments") - protected String inoutputArguments; - - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/inputArguments") - protected String inputArguments; - - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/requestId") - protected String requestId; - - @IRI("https://admin-shell.io/aas/3/0/OperationRequestValueOnly/timeout") - protected BigInteger timeout; - - public DefaultOperationRequestValueOnly() {} - - @Override - public int hashCode() { - return Objects.hash(this.inoutputArguments, - this.inputArguments, - this.requestId, - this.timeout); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultOperationRequestValueOnly other = (DefaultOperationRequestValueOnly) obj; - return Objects.equals(this.inoutputArguments, other.inoutputArguments) && - Objects.equals(this.inputArguments, other.inputArguments) && - Objects.equals(this.requestId, other.requestId) && - Objects.equals(this.timeout, other.timeout); - } - } - - @Override - public String getInoutputArguments() { - return inoutputArguments; - } - - @Override - public void setInoutputArguments(String inoutputArguments) { - this.inoutputArguments = inoutputArguments; - } - - @Override - public String getInputArguments() { - return inputArguments; - } - - @Override - public void setInputArguments(String inputArguments) { - this.inputArguments = inputArguments; - } - - @Override - public String getRequestId() { - return requestId; - } - - @Override - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - @Override - public BigInteger getTimeout() { - return timeout; - } - - @Override - public void setTimeout(BigInteger timeout) { - this.timeout = timeout; - } - - public String toString() { - return String.format( - "DefaultOperationRequestValueOnly (" + "inoutputArguments=%s," - + "inputArguments=%s," - + "requestId=%s," - + "timeout=%s," - + ")", - this.inoutputArguments, this.inputArguments, this.requestId, this.timeout); - } - - /** - * This builder class can be used to construct a DefaultOperationRequestValueOnly bean. - */ - public static class Builder extends OperationRequestValueOnlyBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultOperationRequestValueOnly newBuildingInstance() { - return new DefaultOperationRequestValueOnly(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java deleted file mode 100644 index c9d060be9..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResultValueOnly.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationResultValueOnly; -import org.eclipse.digitaltwin.aas4j.v3.model.Result; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationResultValueOnlyBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationResultValueOnly - * - */ - -@IRI("aas:OperationResultValueOnly") -public class DefaultOperationResultValueOnly implements OperationResultValueOnly { - - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionResult") - protected List executionResult = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/executionState") - protected List executionState = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/inoutputArguments") - protected List inoutputArguments = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/outputArguments") - protected List outputArguments = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/OperationResultValueOnly/requestId") - protected List requestId = new ArrayList<>(); - - public DefaultOperationResultValueOnly() {} - - @Override - public int hashCode() { - return Objects.hash(this.executionResult, - this.executionState, - this.inoutputArguments, - this.outputArguments, - this.requestId); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultOperationResultValueOnly other = (DefaultOperationResultValueOnly) obj; - return Objects.equals(this.executionResult, other.executionResult) && - Objects.equals(this.executionState, other.executionState) && - Objects.equals(this.inoutputArguments, other.inoutputArguments) && - Objects.equals(this.outputArguments, other.outputArguments) && - Objects.equals(this.requestId, other.requestId); - } - } - - @Override - public List getExecutionResult() { - return executionResult; - } - - @Override - public void setExecutionResult(List executionResults) { - this.executionResult = executionResults; - } - - @Override - public List getExecutionState() { - return executionState; - } - - @Override - public void setExecutionState(List executionStates) { - this.executionState = executionStates; - } - - @Override - public List getInoutputArguments() { - return inoutputArguments; - } - - @Override - public void setInoutputArguments(List inoutputArguments) { - this.inoutputArguments = inoutputArguments; - } - - @Override - public List getOutputArguments() { - return outputArguments; - } - - @Override - public void setOutputArguments(List outputArguments) { - this.outputArguments = outputArguments; - } - - @Override - public List getRequestId() { - return requestId; - } - - @Override - public void setRequestId(List requestIds) { - this.requestId = requestIds; - } - - public String toString() { - return String.format( - "DefaultOperationResultValueOnly (" + "executionResult=%s," - + "executionState=%s," - + "inoutputArguments=%s," - + "outputArguments=%s," - + "requestId=%s," - + ")", - this.executionResult, this.executionState, this.inoutputArguments, this.outputArguments, this.requestId); - } - - /** - * This builder class can be used to construct a DefaultOperationResultValueOnly bean. - */ - public static class Builder extends OperationResultValueOnlyBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultOperationResultValueOnly newBuildingInstance() { - return new DefaultOperationResultValueOnly(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index a53eaba9a..73bce3b3a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -84,14 +84,14 @@ public int hashCode() { this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultProperty (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 4bcc919a3..546aa64f4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -84,14 +84,14 @@ public int hashCode() { this.min, this.max, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.min, other.min) && Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRange (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 6893d95a5..dfddd18e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -76,14 +76,14 @@ public DefaultReferenceElement() {} public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -98,14 +98,14 @@ public boolean equals(Object obj) { DefaultReferenceElement other = (DefaultReferenceElement) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -129,36 +129,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -209,6 +179,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultReferenceElement (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 755f7f359..475518459 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -80,14 +80,14 @@ public int hashCode() { return Objects.hash(this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -103,14 +103,14 @@ public boolean equals(Object obj) { return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -144,36 +144,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -224,6 +194,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRelationshipElement (" + "first=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java deleted file mode 100644 index 7b0e9d854..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElementMetadata.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RelationshipElementMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElementMetadata - * - */ - -@IRI("aas:RelationshipElementMetadata") -public class DefaultRelationshipElementMetadata implements RelationshipElementMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultRelationshipElementMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultRelationshipElementMetadata other = (DefaultRelationshipElementMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultRelationshipElementMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultRelationshipElementMetadata bean. - */ - public static class Builder extends RelationshipElementMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultRelationshipElementMetadata newBuildingInstance() { - return new DefaultRelationshipElementMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 2c6a0c9cd..d12c19192 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -78,14 +78,14 @@ public DefaultSubmodelElementCollection() {} public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -100,14 +100,14 @@ public boolean equals(Object obj) { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -131,36 +131,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -211,6 +181,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultSubmodelElementCollection (" + "value=%s," From a33bcc571405318543288b4bd131a84185f1a202 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 21 Nov 2023 17:56:00 +0100 Subject: [PATCH 44/91] clean up --- .../v3/dataformat/aasx/AASXDeserializer.java | 18 +- .../v3/dataformat/aasx/AASXSerializer.java | 16 +- .../aas4j/v3/dataformat/Serializer.java | 119 ----- .../core/DataSpecificationInfo.java | 48 -- .../core/DataSpecificationManager.java | 108 ----- .../v3/dataformat/core/ReflectionHelper.java | 434 ------------------ ...EmbeddedDataSpecificationDeserializer.java | 69 --- .../EmbeddedDataSpecificationSerializer.java | 85 ---- .../core/util/IdentifiableCollector.java | 69 --- .../util/MostSpecificClassComparator.java | 36 -- .../util/MostSpecificTypeTokenComparator.java | 37 -- ...ssetAdministrationShellElementVisitor.java | 39 +- ...ministrationShellElementWalkerVisitor.java | 27 +- .../aas4j/v3/dataformat/mapping/Mapper.java | 27 -- .../v3/dataformat/mapping/MappingContext.java | 40 -- .../dataformat/mapping/MappingException.java | 32 -- .../dataformat/mapping/MappingProvider.java | 136 ------ .../dataformat/mapping/SourceBasedMapper.java | 38 -- .../dataformat/mapping/TargetBasedMapper.java | 38 -- ...ministrationShellDescriptorSerializer.java | 46 -- .../json/GenericAasDeserializer.java | 49 -- .../dataformat/json/GenericAasSerializer.java | 49 -- .../v3/dataformat/json/JsonMapperFactory.java | 15 +- .../dataformat/json/ReferableSerializer.java | 46 -- .../dataformat/json/ReferenceSerializer.java | 47 -- .../ReflectionAnnotationIntrospector.java | 113 ----- .../SimpleAbstractTypeResolverFactory.java | 3 +- .../json/SpecificAssetIdSerializer.java | 47 -- .../json/SubmodelDescriptorSerializer.java | 47 -- .../dataformat/json/mixins/EndpointMixin.java | 3 - .../json/mixins/SubmodelDescriptorMixin.java | 1 - ...rationShellDescriptorDeserializerTest.java | 10 +- ...strationShellDescriptorSerializerTest.java | 1 - .../json/JsonReferableSerializerTest.java | 3 - .../json/JsonReferenceDeserializerTest.java | 26 -- .../json/JsonReferenceSerializerTest.java | 23 +- .../JsonSpecificAssetIdDeserializerTest.java | 4 +- .../JsonSpecificAssetIdSerializerTest.java | 2 - .../JsonSubmodelDescriptorSerializerTest.java | 5 - .../v3/dataformat/json/TestDataHelper.java | 20 +- ...mbeddedDataSpecificationsDeserializer.java | 13 - .../xml/serialization/KeySerializer.java | 47 -- .../serialization/ReferenceSerializer.java | 48 -- .../src/test/resources/invalidXmlExample.xml | 2 +- .../src/test/resources/qualifier_example.xml | 2 +- 45 files changed, 118 insertions(+), 1970 deletions(-) delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java delete mode 100644 dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index ab919fb93..1805f1621 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -15,15 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import org.apache.commons.io.IOUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -40,6 +31,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + /** * The AASX package converter converts a aasx package into a list of aas, a list * of submodels a list of assets, a list of Concept descriptions diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index ebacc682d..8bb559b2a 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -15,14 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.UUID; - import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; @@ -42,6 +34,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; + /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java deleted file mode 100644 index fea84b439..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/Serializer.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; - -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; - -/** - * Generic serializer interface to serialize an instance of - * AssetAdministrationShellEnvironment to a string, Outputstream or java.io.File - */ -public interface Serializer { - - /** - * Default charset that will be used when no charset is specified - */ - Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - - /** - * Serializes a given instance of AssetAdministrationShellEnvironment to - * string - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to - * serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ - String write(Environment aasEnvironment) throws SerializationException; - - /** - * Serializes a given instance of Environment to an - * OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - default void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); - } - - /** - * Serializes a given instance of Environment to an - * OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - default void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); - } - } - - // Note that the AAS also defines a file class - /** - * Serializes a given instance of Environment to a - * java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - default void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); - } - } - - /** - * Serializes a given instance of Environment to a - * java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to - * serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails - */ - default void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); - } - -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java deleted file mode 100644 index 784b2d8e7..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationInfo.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -/** - * Class representing all information required for a (custom) data specification - */ -public class DataSpecificationInfo { - - private final Class type; - private final Reference reference; - private final String prefix; - - public DataSpecificationInfo(Class type, Reference reference, String prefix) { - this.type = type; - this.reference = reference; - this.prefix = prefix; - } - - public Class getType() { - return type; - } - - public Reference getReference() { - return reference; - } - - public String getPrefix() { - return prefix; - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java deleted file mode 100644 index 9bf46b5f9..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DataSpecificationManager.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; -import java.util.Arrays; -import java.util.Objects; -import java.util.Optional; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import java.util.HashSet; -import java.util.Set; -import java.util.function.Predicate; - -/** - * This class is used to manage supported data specification templates. Each - * template is identified through a reference and a prefix and provides a - * corresponding Java class. - */ -public class DataSpecificationManager { - - public static final String PROP_DATA_SPECIFICATION = "dataSpecification"; - public static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationContent"; - public static final String DATA_SPECIFICATION_IEC61360_IRI = "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIec61360/2/0"; - public static final String DATA_SPECIFICATION_IEC61360_PREFIX = "IEC"; - - private static final Set KNOWN_IMPLEMENTATIONS = new HashSet<>(Arrays.asList( - // new DataSpecificationInfo(DataSpecificationIec61360.class, - // createGlobalIri(DATA_SPECIFICATION_IEC61360_IRI), - // DATA_SPECIFICATION_IEC61360_PREFIX) - )); - - /** - * Allows to register an additional data specification template - * - * @param dataSpecification Details of the data specification template to - * register - */ - public static void register(DataSpecificationInfo dataSpecification) { - KNOWN_IMPLEMENTATIONS.add(dataSpecification); - } - - private static Reference createGlobalIri(String iri) { - return new DefaultReference.Builder().keys(Arrays.asList( - new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value(iri).build())) - .build(); - } - - /** - * Returns a DataSpecificationInfo describing the data specification - * template implemented by the given class. If the class is unknown, null is - * returned. - * - * @param implementation type of the implementation class - * @return a DataSpecificationInfo describing the data specification - * template represented by the given class, or null if the implementation - * class does not represent any data specification - */ - public static DataSpecificationInfo getDataSpecification(Class implementation) { - DataSpecificationInfo result = getDataSpecification(x -> Objects.equals(x.getType(), implementation)); - if (result == null) { - result = getDataSpecification(x -> x.getType().isAssignableFrom(implementation)); - } - return result; - } - - /** - * Returns a DataSpecificationInfo describing the data specification - * template implemented by the given class. If the class is unknown, null is - * returned. - * - * @param reference Reference associated with the wanted data specficiation - * @return a DataSpecificationInfo describing the data specification - * template represented by the reference, or null if the reference does not - * represent any data specification - */ - public static DataSpecificationInfo getDataSpecification(Reference reference) { - return getDataSpecification(x -> AasUtils.sameAs(x.getReference(), reference)); - } - - private static DataSpecificationInfo getDataSpecification(Predicate filter) { - Optional exactMatch = KNOWN_IMPLEMENTATIONS.stream() - .filter(filter) - .findFirst(); - if (exactMatch.isPresent()) { - return exactMatch.get(); - } - return null; - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java deleted file mode 100644 index 148c676f8..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/ReflectionHelper.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; - -import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; -import org.apache.commons.lang3.ClassUtils; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import io.github.classgraph.ClassGraph; -import io.github.classgraph.ClassInfo; -import io.github.classgraph.ClassInfoList; -import io.github.classgraph.ScanResult; - -/** - * Helper class to collect relevant data needed for - * ReflectionAnnotationIntrospector via reflection. - */ -public class ReflectionHelper { - - private static final Logger logger = LoggerFactory.getLogger(ReflectionHelper.class); - private static final String ROOT_PACKAGE_NAME = "org.eclipse.digitaltwin.aas4j.v3"; - /** - * Name of package where the generated model classes are defined - */ - public static final String MODEL_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".model"; - /** - * Name of package where the generated default implementation files are - * defined - */ - public static final String DEFAULT_IMPLEMENTATION_PACKAGE_NAME = MODEL_PACKAGE_NAME + ".impl"; - /** - * Name of package where the json mixins are defined. These mixins are - * automatically added to JsonSerializer and JsonDeserializer. - */ - public static final String JSON_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.json.mixins"; - /** - * Name of package where the xml mixins are defined. These mixins are - * automatically added to XmlSerializer and XmlDeserializer. - */ - public static final String XML_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.xml.mixins"; - /** - * Suffix that identifies a class as a mixin. - */ - public static final String MIXIN_SUFFIX = "Mixin"; - /** - * Prefix that defines a class as a default implementation - */ - public static final String DEFAULT_IMPLEMENTATION_PREFIX = "Default"; - /** - * Distinct root superclasses of which classify a class to include type - * information via the modelType property - */ - public static final Set> MODEL_TYPE_SUPERCLASSES = Set.of(Referable.class, DataSpecificationContent.class); - /** - * Expanded list of all classes that shall be annotated with the modelType - * property. - */ - public static final Set> TYPES_WITH_MODEL_TYPE; - /** - * Map of all interfaces and their subinterfaces defined in the - * MODEL_PACKAGE_NAME package. - */ - public static final Map, Set>> SUBTYPES; - /** - * List of all interfaces classes defined by the AAS. - */ - public static final Set INTERFACES; - /** - * Expanded list of all mixin classes defined in the - * JSON_MIXINS_PACKAGE_NAME package together with the corresponding class - * they should be applied to. - */ - public static final Map, Class> JSON_MIXINS; - /** - * Expanded list of all mixin classes defined in the XML_MIXINS_PACKAGE_NAME - * package together with the corresponding class they should be applied to. - */ - public static final Map, Class> XML_MIXINS; - /** - * Expanded list of all default implementations in the - * DEFAULT_IMPLEMENTATION_PACKAGE_NAME package together with the interface - * from the MODEL_PACKAGE_NAME package they are implementing. - */ - public static final List DEFAULT_IMPLEMENTATIONS; - /** - * List of interfaces from the MODEL_PACKAGE_NAME package that are known to - * not have any default implementation and therefore are excluded - * explicitely. - */ - public static final Set> INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION; - /** - * List of enums from the MODEL_PACKAGE_NAME package. - */ - public static final List> ENUMS; - - public static class ImplementationInfo { - - private final Class interfaceType; - private final Class implementationType; - - protected ImplementationInfo(Class interfaceType, Class implementationType) { - this.interfaceType = interfaceType; - this.implementationType = implementationType; - } - - public Class getInterfaceType() { - return interfaceType; - } - - public Class getImplementationType() { - return implementationType; - } - } - - /** - * Returns whether the given class is an interface and from within the - * MODEL_PACKAGE_NAME package - * - * @param type the class to check - * @return whether the given class is an interface and from within the - * MODEL_PACKAGE_NAME package - */ - public static boolean isModelInterface(Class type) { - return type.isInterface() && MODEL_PACKAGE_NAME.equals(type.getPackageName()); - } - - /** - * Returns whether the given class is a default implementation or not - * - * @param type the class to check - * @return whether the given class is a default implementation or not - */ - public static boolean isDefaultImplementation(Class type) { - return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> Objects.equals(x.getImplementationType(), type)); - } - - /** - * Returns whether the given interface has a default implementation or not - * - * @param interfaceType the interface to check - * @return whether the given interface has a default implementation or not - */ - public static boolean hasDefaultImplementation(Class interfaceType) { - return DEFAULT_IMPLEMENTATIONS.stream().anyMatch(x -> x.getInterfaceType().equals(interfaceType)); - } - - /** - * Returns the default implementation for an aas interface or null if the - * class is no aas interface or does not have default implementation - * - * @param interfaceType the interface to check - * @return the default implementation type for given interfaceType or null - * if the class is no aas interface or does not have default implementation - */ - public static Class getDefaultImplementation(Class interfaceType) { - if (isDefaultImplementation(interfaceType)) { - return interfaceType; - } - if (hasDefaultImplementation(interfaceType)) { - return DEFAULT_IMPLEMENTATIONS.stream() - .filter(x -> x.getInterfaceType().equals(interfaceType)) - .findFirst().get() - .getImplementationType(); - } - return null; - } - - /** - * Returns whether the given class is an interface from within the - * MODEL_PACKAGE_NAME package as well as a default implementation or not - * - * @param type the class to check - * @return whether the given class is an interface from within the - * MODEL_PACKAGE_NAME package as well as a default implementation or not - */ - public static boolean isModelInterfaceOrDefaultImplementation(Class type) { - return isModelInterface(type) || isDefaultImplementation(type); - } - - public static Class getAasInterface(Class type) { - Set> implementedAasInterfaces = getAasInterfaces(type); - if (implementedAasInterfaces.isEmpty()) { - return null; - } - if (implementedAasInterfaces.size() == 1) { - return implementedAasInterfaces.iterator().next(); - } - logger.warn("class '{}' implements more than one AAS interface, but only most specific one is returned", type.getName()); - return implementedAasInterfaces.stream().map(x -> TypeToken.of(x)) - .sorted(new MostSpecificTypeTokenComparator()) - .findFirst().get() - .getRawType(); - } - - public static Set> getAasInterfaces(Class type) { - Set> result = new HashSet<>(); - if (type != null) { - if (INTERFACES.contains(type)) { - result.add(type); - } - result.addAll(ClassUtils.getAllInterfaces(type).stream().filter(x -> INTERFACES.contains(x)).collect(Collectors.toSet())); - } - return result; - } - - /** - * Returns the AAS type information used for de-/serialization for a given - * class or null if type information should not be included - * - * @param clazz the class to find the type information for - * @return the type information for the given class or null if there is no - * type information or type information should not be included - */ - public static String getModelType(Class clazz) { - Class type = getMostSpecificTypeWithModelType(clazz); - if (type != null) { - return type.getSimpleName(); - } - for (Class interfaceClass : clazz.getInterfaces()) { - String result = getModelType(interfaceClass); - if (result != null) { - return result; - } - } - Class superClass = clazz.getSuperclass(); - if (superClass != null) { - return getModelType(superClass); - } - return null; - } - - /** - * Returns the most specific supertype that contains some AAS type - * information or null if there is none - * - * @param clazz the class to find the type for - * @return the most specific supertype of given class that contains some AAS - * type information or null if there is none - */ - public static Class getMostSpecificTypeWithModelType(Class clazz) { - if (clazz == null) { - return null; - } - return TYPES_WITH_MODEL_TYPE.stream() - .filter(x -> clazz.isInterface() ? x.equals(clazz) : x.isAssignableFrom(clazz)) - .sorted((Class o1, Class o2) -> { - // -1: o1 more special than o2 - // 0: o1 equals o2 or on same samelevel - // 1: o2 more special than o1 - if (o1.isAssignableFrom(o2)) { - if (o2.isAssignableFrom(o1)) { - return 0; - } - return 1; - } - if (o2.isAssignableFrom(o1)) { - return -1; - } - return 0; - }) - .findFirst() - .orElse(null); - } - - static { - ScanResult modelScan = new ClassGraph() - .enableClassInfo() - .acceptPackagesNonRecursive(MODEL_PACKAGE_NAME) - .scan(); - TYPES_WITH_MODEL_TYPE = scanModelTypes(modelScan); - SUBTYPES = scanSubtypes(modelScan); - JSON_MIXINS = scanMixins(modelScan, JSON_MIXINS_PACKAGE_NAME); - XML_MIXINS = scanMixins(modelScan, XML_MIXINS_PACKAGE_NAME); - DEFAULT_IMPLEMENTATIONS = scanDefaultImplementations(modelScan); - INTERFACES = scanAasInterfaces(); - ENUMS = modelScan.getAllEnums().loadClasses(Enum.class); - INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION = getInterfacesWithoutDefaultImplementation(modelScan); - } - - private static Set> getInterfacesWithoutDefaultImplementation(ScanResult modelScan) { - return modelScan.getAllInterfaces().loadClasses().stream() - .filter(x -> !hasDefaultImplementation(x)) - .collect(Collectors.toSet()); - } - - public static Set> getSuperTypes(Class clazz, boolean recursive) { - Set> result = SUBTYPES.entrySet().stream() - .filter(x -> x.getValue().contains(clazz)) - .map(x -> x.getKey()) - .collect(Collectors.toSet()); - if (recursive) { - result.addAll(result.stream() - .flatMap(x -> getSuperTypes(x, true).stream()) - .collect(Collectors.toSet())); - } - return result; - } - - private static List scanDefaultImplementations(ScanResult modelScan) { - ScanResult defaulImplementationScan = new ClassGraph() - .enableClassInfo() - .acceptPackagesNonRecursive(DEFAULT_IMPLEMENTATION_PACKAGE_NAME) - .scan(); - List defaultImplementations = new ArrayList<>(); - defaulImplementationScan.getAllClasses() - .filter(x -> x.getSimpleName().startsWith(DEFAULT_IMPLEMENTATION_PREFIX)) - .loadClasses() - .stream() - .forEach(x -> { - String interfaceName = x.getSimpleName().substring(DEFAULT_IMPLEMENTATION_PREFIX.length());// using conventions - ClassInfoList interfaceClassInfos = modelScan.getAllClasses().filter(y -> y.isInterface() && Objects.equals(y.getSimpleName(), interfaceName)); - if (interfaceClassInfos.isEmpty()) { - logger.warn("could not find interface realized by default implementation class '{}'", x.getSimpleName()); - } else { - Class implementedClass = interfaceClassInfos.get(0).loadClass(); - defaultImplementations.add(new ImplementationInfo(implementedClass, x)); - logger.debug("using default implementation class '{}' for interface '{}'", - x.getSimpleName(), - interfaceClassInfos.get(0).getName()); - - } - }); - return defaultImplementations; - } - - private static Set scanAasInterfaces() { - return DEFAULT_IMPLEMENTATIONS.stream().map(x -> x.interfaceType).collect(Collectors.toSet()); - } - - private static Map, Class> scanMixins(ScanResult modelScan, String packageName) { - ScanResult mixinScan = new ClassGraph() - .enableClassInfo() - .acceptPackagesNonRecursive(packageName) - .scan(); - Map, Class> mixins = new HashMap<>(); - mixinScan.getAllClasses() - .filter(x -> x.getSimpleName().endsWith(MIXIN_SUFFIX)) - .loadClasses() - .forEach(x -> { - String modelClassName = x.getSimpleName().substring(0, x.getSimpleName().length() - MIXIN_SUFFIX.length()); - ClassInfoList modelClassInfos = modelScan.getAllClasses().filter(y -> Objects.equals(y.getSimpleName(), modelClassName)); - if (modelClassInfos.isEmpty()) { - logger.warn("could not auto-resolve target class for mixin '{}'", x.getSimpleName()); - } else { - mixins.put(modelClassInfos.get(0).loadClass(), x); - logger.debug("using mixin '{}' for class '{}'", - x.getSimpleName(), - modelClassInfos.get(0).getName()); - } - }); - return mixins; - } - - private static Map, Set>> scanSubtypes(ScanResult modelScan) { - return modelScan.getAllInterfaces().stream() - .filter(ReflectionHelper::hasSubclass) - .collect(Collectors.toMap(ClassInfo::loadClass, ReflectionHelper::getSubclasses)); - } - - private static Set> getSubclasses(ClassInfo clazzInfo) { - return clazzInfo.getClassesImplementing() - .directOnly() - .filter(ClassInfo::isInterface) - .loadClasses() - .stream() - .collect(Collectors.toSet()); - } - - private static boolean hasSubclass(ClassInfo clazzInfo) { - return !getSubclasses(clazzInfo).isEmpty(); - } - - private static Set> scanModelTypes(ScanResult modelScan) { - Set> typesWithModelTypes; - typesWithModelTypes = MODEL_TYPE_SUPERCLASSES.stream() - .flatMap(x -> modelScan.getClassesImplementing(x.getName()).loadClasses().stream()) - .collect(Collectors.toSet()); - typesWithModelTypes.addAll(MODEL_TYPE_SUPERCLASSES); - return typesWithModelTypes; - } - - private ReflectionHelper() { - } - - /** - * Overrides empty list fields with null - * @param element - */ - public static void setEmptyListsToNull(Object element) { - - Field[] fields = element.getClass().getDeclaredFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - field.setAccessible(true); - try { - if (field.getType().isAssignableFrom(List.class) && field.get(element)!=null && ((List) field.get(element)).isEmpty()) { - field.set(element, null); - } - } catch (IllegalAccessException e) { - // do nothing - } - field.setAccessible(false); - } - - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java deleted file mode 100644 index 3e782f0d9..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EmbeddedDataSpecificationDeserializer.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization; - -// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; -// import org.eclipse.digitaltwin.aas4j.v3.rc02.model.impl.DefaultEmbeddedDataSpecification; - -// TODO: Update handling of embeddedDataSpecifications -// Currently we expect the following format -// -// "embeddedDataSpecifications": [ -// "embeddedDataSpecifications": {...}, // reference indicating the type -// "dataSpecificationContent": {...} // actual data specification -// ] -// -// In the future, either embeddedDataSpecifications or dataSpecificationContent should be present. -// However, it is still undefined how the actual (sub-)type of dataSpecificationContent should be serialized, so this cannot be implemented right now. -// Therefore, this functionality is currently disabled until standardization progresses. - -/** - * Custom Deserializer for class DataSpecification. First reads property - * PROP_DATA_SPECIFICATION and tries to resolve which Java class to use for - * deserialization based on the found value with the help of - * DataSpecificationManager. - */ -/* public class EmbeddedDataSpecificationDeserializer extends JsonDeserializer { - - @Override - public EmbeddedDataSpecification deserialize(JsonParser parser, DeserializationContext context) - throws IOException, JsonProcessingException { - Object temp = parser.getCodec().readTree(parser); - ObjectNode node = (ObjectNode) temp; - if (node == null) { - return null; - } - JsonNode nodeDataSpecification = node.get(PROP_DATA_SPECIFICATION); - if (nodeDataSpecification == null) { - throw new JsonMappingException(parser, - String.format("data specification must contain node '%s'", PROP_DATA_SPECIFICATION)); - } - JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeDataSpecification); - parserReference.nextToken(); - Reference reference = parserReference.readValueAs(Reference.class); - JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); - if (nodeContent != null) { - Class targetClass = DataSpecificationManager.getDataSpecification(reference).getType(); - JsonParser parserContent = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeContent); - parserContent.nextToken(); - DataSpecificationContent content = parserContent.readValueAs(targetClass); - return new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent(content).build(); - } - return new DefaultEmbeddedDataSpecification.Builder().dataSpecification(reference).build(); - } -} -*/ \ No newline at end of file diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java deleted file mode 100644 index 6a933ea5f..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EmbeddedDataSpecificationSerializer.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization; - -// TODO: import org.eclipse.digitaltwin.aas4j.v3.rc02.model.EmbeddedDataSpecification; - - -/** - * Custom Serializer for class DataSpecification. Adds type information in form - * of a reference. Uses DataSpecificationManager to resolve java type to - * reference. - */ - -// TODO: Solve the problem with EmbeddedDataSpecifications -/*public class EmbeddedDataSpecificationSerializer extends JsonSerializer { - - private static final Logger logger = LoggerFactory.getLogger(EmbeddedDataSpecificationSerializer.class); - - @Override - public void serialize(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider) - throws IOException { - if (data == null) { - return; - } - Reference reference = null; - DataSpecificationContent content = data.getDataSpecificationContent(); - if (content != null) { - DataSpecificationInfo implicitDataSpecification = DataSpecificationManager.getDataSpecification(content.getClass()); - Reference implicitType = implicitDataSpecification != null ? implicitDataSpecification.getReference() : null; - Reference explicitType = data.getDataSpecification(); - if (implicitType == null) { - logger.warn( - "Trying to serialize unknown implementation of DataSpecificationContent ({}). " - + "Use DataSpecificationManager.register(Reference reference, Class implementation) " - + "to register your implementation", - content.getClass()); - if (explicitType == null) { - logger.warn("Missing type information for DataSpecificationContent! Will be serialized without type information."); - } else { - reference = explicitType; - } - } else { - reference = implicitType; - if (explicitType != null && !Objects.equals(implicitType, explicitType)) { - logger.warn("Conflicting type information for DataSpecificationContent (implicit type: {}, explicit type: {}). Explicit type will be used.", - implicitType, explicitType); - reference = explicitType; - } - } - } - if (reference != null || content != null) { - generator.writeStartObject(); - } - if (reference != null) { - generator.writeObjectField(PROP_DATA_SPECIFICATION, reference); - } - if (content != null) { - generator.writeObjectField(PROP_DATA_SPECIFICATION_CONTENT, content); - } - if (reference != null || content != null) { - generator.writeEndObject(); - } - } - - @Override - public void serializeWithType(EmbeddedDataSpecification data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) - throws IOException, JsonProcessingException { - serialize(data, generator, provider); - } - -}*/ diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java deleted file mode 100644 index 30db91945..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/IdentifiableCollector.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor.AssetAdministrationShellElementWalkerVisitor; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -import java.util.HashSet; -import java.util.Set; - -/** - * Collects all Identifiable elements within an - * AssetAdministrationShellEnvironment - */ -public class IdentifiableCollector { - - private Environment env; - - public IdentifiableCollector(Environment env) { - this.env = env; - } - - public Set collect() { - Visitor visitor = new Visitor(); - visitor.visit(env); - return visitor.identifiables; - } - - private class Visitor implements AssetAdministrationShellElementWalkerVisitor { - - Set identifiables = new HashSet<>(); - - @Override - public void visit(AssetAdministrationShell value) { - identifiables.add(value); - AssetAdministrationShellElementWalkerVisitor.super.visit(value); - } - - @Override - public void visit(Submodel value) { - identifiables.add(value); - AssetAdministrationShellElementWalkerVisitor.super.visit(value); - } - - @Override - public void visit(ConceptDescription value) { - identifiables.add(value); - AssetAdministrationShellElementWalkerVisitor.super.visit(value); - } - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java deleted file mode 100644 index a5f2e3bbc..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; - -import java.util.Comparator; - -/** - * Comparator comparing two classes regarding which type is more specific. - */ -public class MostSpecificClassComparator implements Comparator> { - - @Override - public int compare(Class x, Class y) { - if (y.isAssignableFrom(x)) { - if (x.isAssignableFrom(y)) { - return 0; - } - return -1; - } - return 1; - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java deleted file mode 100644 index c71797477..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificTypeTokenComparator.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; - -import com.google.common.reflect.TypeToken; -import java.util.Comparator; - -/** - * Comparator comparing two TypeToken regarding which type is more specific. - */ -public class MostSpecificTypeTokenComparator implements Comparator { - - @Override - public int compare(TypeToken x, TypeToken y) { - if (x.isSubtypeOf(y)) { - if (y.isSubtypeOf(x)) { - return 0; - } - return -1; - } - return 1; - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java index 8d1b5c700..52a45c37c 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java @@ -17,7 +17,44 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; +import org.eclipse.digitaltwin.aas4j.v3.model.Capability; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.EventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.EventPayload; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.HasDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.HasExtensions; +import org.eclipse.digitaltwin.aas4j.v3.model.HasKind; +import org.eclipse.digitaltwin.aas4j.v3.model.HasSemantics; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Operation; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.Range; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java index 01f13d344..bccd513e0 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -16,7 +16,32 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Entity; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.HasDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.HasExtensions; +import org.eclipse.digitaltwin.aas4j.v3.model.HasSemantics; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Operation; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +import org.eclipse.digitaltwin.aas4j.v3.model.Resource; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java deleted file mode 100644 index bf213a4fb..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -/** - * Generic interface used by MappingProvider to infere generic arguments. This - * is used to automatically determine best-matching mapper - * - * @param The type that this Mapper can process - */ -public interface Mapper { - -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java deleted file mode 100644 index 81bc2ca4e..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingContext.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Abstract super-class for a MappingContext that already provides a - * MappingProvider - * - * @param Type of mapper the the MappingProvider can operate on - */ -public abstract class MappingContext { - - protected static final Logger log = LoggerFactory.getLogger(MappingContext.class); - protected final MappingProvider mappingProvider; - - public MappingContext(MappingProvider mappingProvider) { - this.mappingProvider = mappingProvider; - } - - public MappingProvider getMappingProvider() { - return mappingProvider; - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java deleted file mode 100644 index fafbec74e..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -/** - * Exception throw upon any error on mapping - */ -public class MappingException extends Exception { - - public MappingException(String msg) { - super(msg); - } - - public MappingException(String msg, Throwable err) { - super(msg, err); - } - -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java deleted file mode 100644 index c69de2381..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingProvider.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificClassComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.MostSpecificTypeTokenComparator; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Manages a set of mappers and allows finding them by type. This is the - * cornerstone functionality of the mapping framework. - * - * @param Type of mappers that are supported - */ -public class MappingProvider { - - private static final Logger log = LoggerFactory.getLogger(MappingProvider.class); - - private final T defaultMapper; - private final T defaultCollectionMapper; - private final Map, List> mappings = new HashMap<>(); - - public MappingProvider(Class type, - Mapper defaultMapper, - Mapper> defaultCollectionMapper) { - if (type == null) { - throw new IllegalArgumentException("type must be non-null"); - } - if (defaultMapper == null) { - throw new IllegalArgumentException("defaultMapper must be non-null"); - } - if (defaultCollectionMapper == null) { - throw new IllegalArgumentException("defaultCollectionMapper must be non-null"); - } - if (!type.isAssignableFrom(defaultMapper.getClass())) { - throw new IllegalArgumentException("defaultMapper must be of type " + type); - } - if (!type.isAssignableFrom(defaultCollectionMapper.getClass())) { - throw new IllegalArgumentException("defaultCollectionMapper must be of type " + type); - } - this.defaultMapper = (T) defaultMapper; - this.defaultCollectionMapper = (T) defaultCollectionMapper; - } - - public void register(T mapper) { - TypeToken key = getMappedType(mapper.getClass()); - if (!mappings.containsKey(key)) { - mappings.put(key, new ArrayList<>()); - } - mappings.get(key).add(mapper); - } - - private TypeToken getMappedType(Class type) { - return TypeToken.of(type) - .getTypes().stream() - .filter(y -> Mapper.class.equals(y.getRawType())) - .findFirst() - .get() - .resolveType(Mapper.class.getTypeParameters()[0]); - } - - /** - * Find the most specific mapper for a given object. - * - * @param obj The object to find a suitable mapper for. If this is an - * instance of Type (e.g. a Class) type information for that is returned. - * @return The most specific mapper for the given object - */ - public T getMapper(Object obj) { - if (obj == null) { - return getMapper(Object.class); - } - if (Type.class.isAssignableFrom(obj.getClass())) { - return getMapper((Type) obj); - } - return getMapper(obj.getClass()); - } - - /** - * Find the most specific mapper for a given type. - * - * @param type The type to find a suitable mapper for. - * @return The most specific mapper for the given type - */ - public T getMapper(Type type) { - Optional> customMapper = mappings.entrySet().stream() - .filter(x -> x.getKey().isSupertypeOf(type)) - .sorted((x, y) -> Objects.compare(x.getKey(), y.getKey(), new MostSpecificTypeTokenComparator())) - .map(x -> x.getValue()) - .findFirst(); - if (customMapper.isEmpty() && !TypeToken.of(Collection.class).isSupertypeOf(type)) { - customMapper = mappings.entrySet().stream() - .filter(x -> x.getKey().getRawType().isAssignableFrom(TypeToken.of(type).getRawType())) - .sorted((x, y) -> Objects.compare(x.getKey().getRawType(), y.getKey().getRawType(), new MostSpecificClassComparator())) - .map(x -> x.getValue()) - .findFirst(); - } - if (customMapper.isEmpty() || customMapper.get().isEmpty()) { - if (TypeToken.of(Collection.class).isSupertypeOf(type) && defaultCollectionMapper != null) { - return defaultCollectionMapper; - } - return defaultMapper; - } - if (customMapper.get().size() > 1) { - log.warn("found {} equally suitable mappers for type '{}'", customMapper.get().size(), type); - } - return customMapper.get().get(0); - } - -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java deleted file mode 100644 index 3b53fb72b..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/SourceBasedMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -/** - * A mapper that when mapping from A to B allows to write mappers based on the - * classes of A (the source of the mapping) - * - * @param type that the mapper accepts, here: any class of A - * @param the generator type, here: to generate instances of B - * @param the type of mapping context - */ -public interface SourceBasedMapper extends Mapper { - - /** - * Maps the given value to target format via the generator. - * - * @param value the value to map - * @param generator the generator to write the mapping result to - * @param context the context of the mapping - * @throws MappingException - */ - public void map(T value, G generator, C context) throws MappingException; -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java deleted file mode 100644 index ef75d513e..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/TargetBasedMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.mapping; - -/** - * A mapper that when mapping from A to B allows to write mappers based on the - * classes of B (the target of the mapping) - * - * @param type that the mapper accepts, here: any class of B - * @param

the parser type, here: to parse data of A - * @param the type of mapping context - */ -public interface TargetBasedMapper> extends Mapper { - - /** - * Reads from the parser and returns the mapping result. - * - * @param parser the parser to read the actual input - * @param context the context - * @return a new instance of T created by mapping data given by the parser - * @throws MappingException - */ - public T map(P parser, C context) throws MappingException; -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java deleted file mode 100644 index 12a9d9330..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/AssetAdministrationShellDescriptorSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 SAP SE - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.util.List; - -/** - * Serializer Interface for serialization of AssetAdministrationShellDescriptor - */ -public interface AssetAdministrationShellDescriptorSerializer { - - /** - * Serializes a given instance of a AssetAdministrationShellDescriptor to string - * - * @param assetAdministrationShellDescriptor the AssetAdministrationShellDescriptor to serialize - * @return the string representation of the SpecificAssetId - * @throws SerializationException if serialization fails - */ - String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException; - - /** - * - * @param assetAdministrationShellDescriptors the references to serialize - * @return the string representation of the list of SubmodelDescriptors - * @throws SerializationException if serialization fails - */ - String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java deleted file mode 100644 index 0e9ee092e..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasDeserializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) SAP SE 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; - -import java.util.List; - -/** - * Serializer Interface for serialization of any AAS metamodel class - */ -public interface GenericAasDeserializer { - - /** - * Deserializes a given JSON String of an arbitrary AAS element - * - * @param aas_element the AAS-conform JSON object to deserialize - * @param outputClass the expected class of the aas_element - * @return the default implementation of the AAS-conform element class - * @throws DeserializationException if the deserialization fails - */ - T read(String aas_element, Class outputClass) throws DeserializationException ; - - - /** - * Deserializes a given JSON array to a list of AAS element - * - * @param aas_array the AAS-conform JSON array to deserialize - * @param outputClass the expected type of the aas_array elements - * @return a list of the default implementations of the aas_array elements - * @param type of the returned element - * @throws DeserializationException - */ - List readList(String aas_array, Class outputClass) throws DeserializationException ; -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java deleted file mode 100644 index ad88697b8..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/GenericAasSerializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) SAP SE 2022 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - -import java.util.List; - -/** - * Serializer Interface for serialization of any AAS metamodel class - */ -public interface GenericAasSerializer { - - /** - * Serializes a given instance of an aas element to string - * - * @param aas_element the AAS-conform element to serialize - * @return the string representation of the AAS-conform element - * @throws SerializationException if serialization fails - */ - String write(T aas_element) throws SerializationException; - - - /** - * Serializes a list of aas elements to string - * - * @param aas_elements a list of AAS-conform elements to serialize - * @param the type of the AAS elements - * @return a serialised JSON array as a string - * @throws SerializationException if serialization fails - */ - String writeList(List aas_elements, Class outputClass) throws SerializationException; - - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index a849c7370..99431bc39 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -16,14 +16,6 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.SerializationFeature; @@ -31,6 +23,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper.Builder; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; + +import java.util.Arrays; +import java.util.List; /** * Factory for creating a {@link JsonMapper} configured to produce and consume AAS Version 3 conformant JSON serializations diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java deleted file mode 100644 index b3e6e375d..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferableSerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - -import java.util.List; - -/** - * Serializer Interface for serialization of referables - */ -public interface ReferableSerializer { - - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - String writeReferable(Referable referable) throws SerializationException; - - /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables - * @throws SerializationException if serialization fails - */ - String writeReferables(List referables) throws SerializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java deleted file mode 100644 index ca1a7c7e5..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReferenceSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -/** - * Serializer Interface for serialization of referables - */ -public interface ReferenceSerializer { - - /** - * Serializes a given instance of a Referable to string - * - * @param reference the Reference to serialize - * @return the string representation of the reference - * @throws SerializationException if serialization fails - */ - String writeReference(Reference reference) throws SerializationException; - - /** - * - * @param references the references to serialize - * @return the string representation of the list of references - * @throws SerializationException if serialization fails - */ - String writeReferences(List references) throws SerializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java deleted file mode 100644 index 1fd77253c..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospector.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.cfg.MapperConfig; -import com.fasterxml.jackson.databind.introspect.Annotated; -import com.fasterxml.jackson.databind.introspect.AnnotatedClass; -import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; -import com.fasterxml.jackson.databind.jsontype.NamedType; -import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - -/** - * This class helps to dynamically decide how to de-/serialize classes and - * properties defined in the AAS model library. - * - * This is equivalent to adding the following annotations - *

    - *
  • to all interfaces defined in the AAS model: - *
      - *
    • @JsonTypeName([interface name]) - *
    • @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "modelType") - *
    • @JsonSubTypes({ - * - * \@Type(value = [sub-interface].class, name = "[sub-interface name]"), ...}) - * for each sub-interface - *
    - *
  • to all getter methods returning any type of Collection<?> defined in the - * AAS model: - *
      - *
    • @JsonInclude(JsonInclude.Include.NON_EMPTY)
    • - *
    - *
- */ -public class ReflectionAnnotationIntrospector extends JacksonAnnotationIntrospector { - - private static final long serialVersionUID = 1L; - - private static final String MODEL_TYPE_PROPERTY = "modelType"; - private static final String GETTER_PREFIX = "get"; - - @Override - public String findTypeName(AnnotatedClass ac) { - String customType = ReflectionHelper.getModelType(ac.getRawType()); - return customType != null - ? customType - : super.findTypeName(ac); - } - - @Override - public TypeResolverBuilder findTypeResolver(MapperConfig config, AnnotatedClass ac, JavaType baseType) { - String modelType = ReflectionHelper.getModelType(ac.getRawType()); - if (modelType != null) { - TypeResolverBuilder result = _constructStdTypeResolverBuilder(); - result = result.init(JsonTypeInfo.Id.NAME, null); - result.inclusion(JsonTypeInfo.As.PROPERTY); - result.typeProperty(MODEL_TYPE_PROPERTY); - result.typeIdVisibility(false); - return result; - } - return super.findTypeResolver(config, ac, baseType); - } - - @Override - public List findSubtypes(Annotated a) { - if (ReflectionHelper.SUBTYPES.containsKey(a.getRawType()) && !ReflectionHelper.SUBTYPES.get(a.getRawType()).isEmpty()) { - return ReflectionHelper.SUBTYPES.get(a.getRawType()).stream() - .map(x -> new NamedType(x, x.getSimpleName())) - .collect(Collectors.toList()); - } - return super.findSubtypes(a); - } - - @Override - public JsonInclude.Value findPropertyInclusion(Annotated a) { - JsonInclude.Value result = super.findPropertyInclusion(a); - if (result != JsonInclude.Value.empty()) { - return result; - } - if (AnnotatedMethod.class.isAssignableFrom(a.getClass())) { - AnnotatedMethod method = (AnnotatedMethod) a; - if (method.getParameterCount() == 0 - && method.getName().startsWith(GETTER_PREFIX) - && Collection.class.isAssignableFrom(method.getRawReturnType()) - && ReflectionHelper.isModelInterfaceOrDefaultImplementation(method.getDeclaringClass())) { - return result.withValueInclusion(JsonInclude.Include.NON_EMPTY); - } - } - return result; - } - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java index 742af85ab..54ccfd8fb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java @@ -16,9 +16,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; - import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; /** * Factory for creating a {@link SimpleAbstractTypeResolver} configured with the diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java deleted file mode 100644 index 4f51d6d2a..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SpecificAssetIdSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; - -import java.util.List; - -/** - * Serializer Interface for serialization of referables - */ -public interface SpecificAssetIdSerializer { - - /** - * Serializes a given instance of a Referable to string - * - * @param specificAssetId the SpecificAssetId to serialize - * @return the string representation of the SpecificAssetId - * @throws SerializationException if serialization fails - */ - String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException; - - /** - * - * @param specificAssetIds the references to serialize - * @return the string representation of the list of SpecificAssetIds - * @throws SerializationException if serialization fails - */ - String writeSpecificAssetIds(List specificAssetIds) throws SerializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java deleted file mode 100644 index 4902bc2d5..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SubmodelDescriptorSerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.util.List; - -/** - * Serializer Interface for serialization of SubmodelDescriptor - */ -public interface SubmodelDescriptorSerializer { - - /** - * Serializes a given instance of a SubmodelDescriptor to string - * - * @param submodelDescriptor the SubmodelDescriptor to serialize - * @return the string representation of the SpecificAssetId - * @throws SerializationException if serialization fails - */ - String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException; - - /** - * - * @param submodelDescriptors the references to serialize - * @return the string representation of the list of SubmodelDescriptors - * @throws SerializationException if serialization fails - */ - String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException; - -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java index 42cf4b58b..c0570ffe8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java @@ -17,9 +17,6 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; - -import java.util.List; public interface EndpointMixin { diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java index 86bf6f300..23729b25e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import java.util.List; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index da17bd88c..ebcc2fbd7 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -17,9 +17,12 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,7 +30,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.util.Arrays; import java.util.List; import static org.junit.Assert.assertEquals; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index c1af7a607..39774e7ee 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -18,7 +18,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.json.JSONException; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index 723a8443f..a57394953 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; @@ -33,9 +32,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; - import org.json.JSONException; - import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 7f3a97f18..7c7354d3b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -19,7 +19,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.junit.Before; @@ -30,7 +29,6 @@ import java.util.List; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; public class JsonReferenceDeserializerTest { @@ -46,7 +44,6 @@ public void prepare() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); -// valueReferencePair_string = serializer.write(((DataSpecificationIec61360) AASFull.ENVIRONMENT.getConceptDescriptions().get(3).getEmbeddedDataSpecifications().get(0).getDataSpecificationContent()).getValueList().getValueReferencePairs().get(0)); } @@ -59,29 +56,6 @@ public void testDeserializeReference() throws DeserializationException { assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); } -// @Test -// public void testValueReferencePair() throws DeserializationException { -// JsonDeserializer deserializer = new JsonDeserializer(); -// -// ValueReferencePair valueReferencePair = deserializer.read(valueReferencePair_string, ValueReferencePair.class); -// -// assertTrue(!valueReferencePair.getValue().isEmpty()); -// } - -// @Test -// @Ignore("No comparison of input string object to expected class implememted yet.") -// public void testNonAasElement() { -// JsonDeserializer deserializer = new JsonDeserializer(); -// -// try { -// ValueReferencePair valueReferencePair = deserializer.read(reference_string, ValueReferencePair.class); -// } catch (DeserializationException e) { -// // fine -// } -// -// fail("DeserializationException expected"); -// } - @Test public void testDeserializeReferenceList() throws DeserializationException { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java index c744f9ff6..1c60012c4 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -18,16 +18,14 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.junit.Ignore; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; public class JsonReferenceSerializerTest { @@ -47,23 +45,6 @@ public void testSerializeReference() throws SerializationException { } -// @Test -// @Ignore("If the input parameter is not an AAS-defined element, plain Jackson works nevertheless...") -// public void testNonAasElement() throws SerializationException { -// JsonSerializer serializer = new JsonSerializer(); -// -// Object object = new ArrayList() {{ add("something"); }}; -// -// try { -// String output = serializer.write(object); -// } catch (SerializationException e) { -// // fine -// } -// -// fail("SerializationException expected"); -// } - - @Test public void testSerializeReferenceList() throws SerializationException { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java index 06324f3ce..9ee7c27b8 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -16,11 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.checkerframework.checker.units.qual.A; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.*; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java index d449463fe..39e2a0b11 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -16,11 +16,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java index f82b47696..03acb794d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -16,11 +16,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.json.JSONException; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -31,10 +28,8 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.util.List; import java.util.Set; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class JsonSubmodelDescriptorSerializerTest { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 36220a8da..04aa3a6d6 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -3,8 +3,24 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.eclipse.digitaltwin.aas4j.v3.model.*; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.*; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 5d1e2130c..24bbd0e04 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -16,13 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; -import java.io.IOException; -import java.util.Objects; -import java.util.Set; - -import org.apache.commons.lang3.tuple.Pair; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -34,12 +27,6 @@ import java.io.IOException; -import static java.util.Spliterator.ORDERED; -import static java.util.Spliterators.spliteratorUnknownSize; -import static java.util.stream.StreamSupport.stream; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.core.ReflectionHelper.getDefaultImplementation; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.DeserializationHelper.createInstanceFromNode; - public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java deleted file mode 100644 index 95be43225..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/KeySerializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import java.io.IOException; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.AasUtils; - -import org.eclipse.digitaltwin.aas4j.v3.model.Key; - -public class KeySerializer extends JsonSerializer { - - @Override - public void serialize(Key key, JsonGenerator gen, SerializerProvider serializers) throws IOException { - ToXmlGenerator xgen = (ToXmlGenerator) gen; - xgen.writeObjectFieldStart("key"); - - String keyTypeValue = key.getType().toString(); - xgen.setNextIsAttribute(false); - xgen.writeFieldName("type"); - xgen.writeString(key.getType().name()); - - xgen.setNextIsAttribute(false); - xgen.writeFieldName("value"); - xgen.writeString(key.getValue()); - - xgen.writeEndObject(); - } -} diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java deleted file mode 100644 index 7313d9a02..000000000 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/ReferenceSerializer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; - -import java.io.IOException; - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonSerializer; -import com.fasterxml.jackson.databind.SerializerProvider; - -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public class ReferenceSerializer extends JsonSerializer { - private NoEntryWrapperListSerializer keyListSerializer; - - public ReferenceSerializer() { -// this.keyListSerializer = new NoEntryWrapperListSerializer<>(); -// this.keyListSerializer.setOuterWrapper("keys"); - } - - @Override - public void serialize(Reference reference, JsonGenerator gen, SerializerProvider serializers) throws IOException { - ToXmlGenerator xgen = (ToXmlGenerator) gen; -// xgen.setNextIsUnwrapped(true); -// xgen.writeObjectFieldStart("type"); - xgen.writeString(reference.getType().name()); - -// List keys = reference.getKeys(); -// this.keyListSerializer.serialize(keys, gen, serializers); - } - -} diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index d8824c2cd..9ec4fec01 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation=""> \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index 632f22211..d4b93158d 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation=""> TestSubmodel From 30ca328660156647353a0a23bd3f4a8a435dbbf4 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 21 Nov 2023 17:57:19 +0100 Subject: [PATCH 45/91] clean up --- ...ssetAdministrationShellElementVisitor.java | 302 ------------------ ...ministrationShellElementWalkerVisitor.java | 296 ----------------- 2 files changed, 598 deletions(-) delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java delete mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java deleted file mode 100644 index 52a45c37c..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementVisitor.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; - - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Blob; -import org.eclipse.digitaltwin.aas4j.v3.model.Capability; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.Entity; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.EventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.EventPayload; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.HasDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.HasExtensions; -import org.eclipse.digitaltwin.aas4j.v3.model.HasKind; -import org.eclipse.digitaltwin.aas4j.v3.model.HasSemantics; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Operation; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Range; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; - - - -public interface AssetAdministrationShellElementVisitor { - - - public default void visit(DataElement dataElement) { - if (dataElement == null) { - return; - } - Class type = dataElement.getClass(); - if (Property.class.isAssignableFrom(type)) { - visit((Property) dataElement); - } else if (MultiLanguageProperty.class.isAssignableFrom(type)) { - visit((MultiLanguageProperty) dataElement); - } else if (Range.class.isAssignableFrom(type)) { - visit((Range) dataElement); - } else if (ReferenceElement.class.isAssignableFrom(type)) { - visit((ReferenceElement) dataElement); - } else if (File.class.isAssignableFrom(type)) { - visit((File) dataElement); - } else if (Blob.class.isAssignableFrom(type)) { - visit((Blob) dataElement); - } - } - - public default void visit(DataSpecificationContent dataSpecificationContent) { - if (dataSpecificationContent == null) { - return; - } - Class type = dataSpecificationContent.getClass(); - // if (DataSpecificationIec61360.class.isAssignableFrom(type)) { - // visit((DataSpecificationIec61360) dataSpecificationContent); - //} - } - - public default void visit(EventElement event) { - if (event == null) { - return; - } - Class type = event.getClass(); - if (BasicEventElement.class.isAssignableFrom(type)) { - visit((BasicEventElement) event); - } - } - - public default void visit(HasDataSpecification hasDataSpecification) { - if (hasDataSpecification == null) { - return; - } - Class type = hasDataSpecification.getClass(); - if (AssetAdministrationShell.class.isAssignableFrom(type)) { - visit((AssetAdministrationShell) hasDataSpecification); - } else if (Submodel.class.isAssignableFrom(type)) { - visit((Submodel) hasDataSpecification); - } else if (SubmodelElement.class.isAssignableFrom(type)) { - visit((SubmodelElement) hasDataSpecification); - } - - } - - public default void visit(HasExtensions hasExtensions) { - if (hasExtensions == null) { - return; - } - Class type = hasExtensions.getClass(); - if (Referable.class.isAssignableFrom(type)) { - visit((Referable) hasExtensions); - } - } - - public default void visit(HasKind hasKind) { - if (hasKind == null) { - return; - } - Class type = hasKind.getClass(); - if (Submodel.class.isAssignableFrom(type)) { - visit((Submodel) hasKind); - } else if (SubmodelElement.class.isAssignableFrom(type)) { - visit((SubmodelElement) hasKind); - } - } - - public default void visit(HasSemantics hasSemantics) { - if (hasSemantics == null) { - return; - } - Class type = hasSemantics.getClass(); - if (Extension.class.isAssignableFrom(type)) { - visit((Extension) hasSemantics); - } else if (SpecificAssetId.class.isAssignableFrom(type)) { - visit((SpecificAssetId) hasSemantics); - } else if (Submodel.class.isAssignableFrom(type)) { - visit((Submodel) hasSemantics); - } else if (SubmodelElement.class.isAssignableFrom(type)) { - visit((SubmodelElement) hasSemantics); - } else if (Qualifier.class.isAssignableFrom(type)) { - visit((Qualifier) hasSemantics); - } - } - - public default void visit(Identifiable identifiable) { - if (identifiable == null) { - return; - } - Class type = identifiable.getClass(); - if (AssetAdministrationShell.class.isAssignableFrom(type)) { - visit((AssetAdministrationShell) identifiable); - } else if (Submodel.class.isAssignableFrom(type)) { - visit((Submodel) identifiable); - } else if (ConceptDescription.class.isAssignableFrom(type)) { - visit((ConceptDescription) identifiable); - } - } - - public default void visit(SubmodelElement submodelElement) { - if (submodelElement == null) { - return; - } - Class type = submodelElement.getClass(); - if (RelationshipElement.class.isAssignableFrom(type)) { - visit((RelationshipElement) submodelElement); - } else if (DataElement.class.isAssignableFrom(type)) { - visit((DataElement) submodelElement); - } else if (Capability.class.isAssignableFrom(type)) { - visit((Capability) submodelElement); - } else if (SubmodelElementCollection.class.isAssignableFrom(type)) { - visit((SubmodelElementCollection) submodelElement); - } else if (Operation.class.isAssignableFrom(type)) { - visit((Operation) submodelElement); - } else if (EventElement.class.isAssignableFrom(type)) { - visit((EventElement) submodelElement); - } else if (Entity.class.isAssignableFrom(type)) { - visit((Entity) submodelElement); - } - } - - public default void visit(Qualifiable qualifiable) { - if (qualifiable == null) { - return; - } - Class type = qualifiable.getClass(); - if (Submodel.class.isAssignableFrom(type)) { - visit((Submodel) qualifiable); - } else if (SubmodelElement.class.isAssignableFrom(type)) { - visit((SubmodelElement) qualifiable); - } - } - - public default void visit(Referable referable) { - if (referable == null) { - return; - } - Class type = referable.getClass(); - if (Identifiable.class.isAssignableFrom(type)) { - visit((Identifiable) referable); - } else if (SubmodelElement.class.isAssignableFrom(type)) { - visit((SubmodelElement) referable); - } - } - - public default void visit(Environment assetAdministrationShellEnvironment) { - } - - public default void visit(AdministrativeInformation administrativeInformation) { - } - - public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { - } - - public default void visit(AssetAdministrationShell assetAdministrationShell) { - } - - public default void visit(AssetInformation assetInformation) { - } - - public default void visit(BasicEventElement basicEvent) { - } - - public default void visit(Blob blob) { - } - - public default void visit(Capability capability) { - } - - public default void visit(ConceptDescription conceptDescription) { - } - - //public default void visit(EmbeddedDataSpecification embeddedDataSpecification) { - //} - - public default void visit(Entity entity) { - } - public default void visit(EventPayload eventMessage) { - } - - public default void visit(Extension extension) { - } - - public default void visit(File file) { - } - - public default void visit(SpecificAssetId identifierKeyValuePair) { - } - - public default void visit(Key key) { - } - - public default void visit(MultiLanguageProperty multiLanguageProperty) { - } - - public default void visit(Operation operation) { - } - - public default void visit(OperationVariable operationVariable) { - } - - public default void visit(Property property) { - } - - public default void visit(Qualifier qualifier) { - } - - public default void visit(Range range) { - } - - public default void visit(Reference reference) { - } - - public default void visit(ReferenceElement referenceElement) { - } - - public default void visit(RelationshipElement relationshipElement) { - } - - public default void visit(Submodel submodel) { - } - - public default void visit(SubmodelElementCollection submodelElementCollection) { - } - - public default void visit(Resource resource) { - - } -} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java deleted file mode 100644 index bccd513e0..000000000 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.visitor; - -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Entity; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.HasDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.HasExtensions; -import org.eclipse.digitaltwin.aas4j.v3.model.HasSemantics; -import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Operation; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifiable; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.Resource; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; - - -public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { - - - @Override - public default void visit(AnnotatedRelationshipElement annotatedRelationshipElement) { - if (annotatedRelationshipElement == null) { - return; - } - annotatedRelationshipElement.getAnnotations().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(annotatedRelationshipElement); - } - - @Override - public default void visit(AssetAdministrationShell assetAdministrationShell) { - if (assetAdministrationShell == null) { - return; - } - visit(assetAdministrationShell.getDerivedFrom()); - visit(assetAdministrationShell.getAssetInformation()); - assetAdministrationShell.getSubmodels().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShell); - } - - @Override - public default void visit(AssetInformation assetInformation) { - if (assetInformation == null) { - return; - } - //visit(assetInformation.getGlobalAssetId()); - assetInformation.getSpecificAssetIds().forEach(x -> visit(x)); - visit(assetInformation.getDefaultThumbnail()); - AssetAdministrationShellElementVisitor.super.visit(assetInformation); - } - - @Override - public default void visit(Resource resource) { - if (resource == null) { - return; - } - AssetAdministrationShellElementVisitor.super.visit(resource); - } - - @Override - public default void visit(BasicEventElement basicEvent) { - if (basicEvent == null) { - return; - } - visit(basicEvent.getObserved()); - AssetAdministrationShellElementVisitor.super.visit(basicEvent); - } - - @Override - public default void visit(ConceptDescription conceptDescription) { - if (conceptDescription == null) { - return; - } - conceptDescription.getIsCaseOf().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(conceptDescription); - } - - @Override - public default void visit(HasDataSpecification hasDataSpecification) { - if (hasDataSpecification == null) { - return; - } - //hasDataSpecification.getEmbeddedDataSpecifications().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(hasDataSpecification); - } - - @Override - public default void visit(HasExtensions hasExtensions) { - if (hasExtensions == null) { - return; - } - hasExtensions.getExtensions().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(hasExtensions); - } - - @Override - public default void visit(HasSemantics hasSemantics) { - if (hasSemantics == null) { - return; - } - visit(hasSemantics.getSemanticId()); - AssetAdministrationShellElementVisitor.super.visit(hasSemantics); - } - - @Override - public default void visit(Identifiable identifiable) { - if (identifiable == null) { - return; - } - visit(identifiable.getAdministration()); - AssetAdministrationShellElementVisitor.super.visit(identifiable); - } - - @Override - public default void visit(SpecificAssetId specificAssetId) { - if (specificAssetId == null) { - return; - } - visit(specificAssetId.getExternalSubjectId()); - AssetAdministrationShellElementVisitor.super.visit(specificAssetId); - } - - @Override - public default void visit(MultiLanguageProperty multiLanguageProperty) { - if (multiLanguageProperty == null) { - return; - } - //multiLanguageProperty.getValue().forEach(x -> visit(x)); - visit(multiLanguageProperty.getValueId()); - AssetAdministrationShellElementVisitor.super.visit(multiLanguageProperty); - } - - @Override - public default void visit(OperationVariable operationVariable) { - if (operationVariable == null) { - return; - } - visit(operationVariable.getValue()); - AssetAdministrationShellElementVisitor.super.visit(operationVariable); - } - - @Override - public default void visit(Property property) { - if (property == null) { - return; - } - visit(property.getValueId()); - AssetAdministrationShellElementVisitor.super.visit(property); - } - - @Override - public default void visit(Qualifiable qualifiable) { - if (qualifiable == null) { - return; - } - qualifiable.getQualifiers().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(qualifiable); - } - - @Override - public default void visit(Qualifier qualifier) { - if (qualifier == null) { - return; - } - visit(qualifier.getValueId()); - AssetAdministrationShellElementVisitor.super.visit(qualifier); - } - - @Override - public default void visit(Referable referable) { - if (referable == null) { - return; - } - // referable.getDescription().forEach(x -> visit(x)); - // referable.getDisplayName().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(referable); - } - - @Override - public default void visit(Reference reference) { - if (reference == null) { - return; - } - reference.getKeys().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(reference); - } - - @Override - public default void visit(ReferenceElement referenceElement) { - if (referenceElement == null) { - return; - } - visit(referenceElement.getValue()); - AssetAdministrationShellElementVisitor.super.visit(referenceElement); - } - - @Override - public default void visit(RelationshipElement relationshipElement) { - if (relationshipElement == null) { - return; - } - visit(relationshipElement.getFirst()); - visit(relationshipElement.getSecond()); - AssetAdministrationShellElementVisitor.super.visit(relationshipElement); - } - - @Override - public default void visit(Entity entity) { - if (entity == null) { - return; - } - //visit(entity.getGlobalAssetId()); - entity.getSpecificAssetIds().forEach(x -> visit(x)); - entity.getStatements().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(entity); - } - - @Override - public default void visit(Extension extension) { - if (extension == null) { - return; - } - extension.getRefersTo().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(extension); - } - - @Override - public default void visit(Environment assetAdministrationShellEnvironment) { - if (assetAdministrationShellEnvironment == null) { - return; - } - assetAdministrationShellEnvironment.getAssetAdministrationShells().forEach(x -> visit(x)); - assetAdministrationShellEnvironment.getConceptDescriptions().forEach(x -> visit(x)); - assetAdministrationShellEnvironment.getSubmodels().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(assetAdministrationShellEnvironment); - } - - @Override - public default void visit(Submodel submodel) { - if (submodel == null) { - return; - } - submodel.getSubmodelElements().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(submodel); - } - - @Override - public default void visit(SubmodelElementCollection submodelElementCollection) { - if (submodelElementCollection == null) { - return; - } - submodelElementCollection.getValue().forEach(x -> visit(x)); - AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); - } - - @Override - public default void visit(Operation operation) { - if (operation == null) { - return; - } - operation.getInputVariables().forEach(x -> visit(x.getValue())); - operation.getInoutputVariables().forEach(x -> visit(x.getValue())); - operation.getOutputVariables().forEach(x -> visit(x.getValue())); - AssetAdministrationShellElementVisitor.super.visit(operation); - } - -} From 58bd8e64aa82acce5d4630797f5d3f84c19f3317 Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 28 Nov 2023 16:17:31 +0100 Subject: [PATCH 46/91] fix securityattributes type enum bug --- .../core/serialization/EnumSerializer.java | 3 +++ .../aas4j/v3/dataformat/json/TestDataHelper.java | 9 ++++++++- .../assetAdministrationShellDescriptor.json | 14 ++++++++++++-- .../src/test/resources/submodelDescriptor.json | 7 ++++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index 425e9cfdc..190d8c886 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -23,6 +23,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import java.io.IOException; @@ -52,6 +53,8 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider } } else if (value instanceof DataTypeIec61360) { gen.writeString(value.name().toUpperCase()); + } else if (value instanceof SecurityTypeEnum) { + gen.writeString(value.name().toUpperCase()); } else if (value instanceof Direction || value instanceof StateOfEvent) { gen.writeString(value.name().toLowerCase()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 04aa3a6d6..b49a54e35 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -11,6 +11,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; @@ -21,6 +22,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; import java.util.List; @@ -88,6 +90,11 @@ public static DefaultProtocolInformation.Builder createProtocolInformationBuilde .endpointProtocolVersion(List.of("defaultEndpointProtocolVersion")) .subprotocol("defaultSubprotocol") .subprotocolBody("defaultSubprotocolBody") - .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding"); + .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding") + .securityAttributes(new DefaultSecurityAttributeObject.Builder() + .key("NONE") + .type(SecurityTypeEnum.NONE) + .value("NONE") + .build()); } } diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json index 2f9502f5d..ab5c8fed5 100644 --- a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json +++ b/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json @@ -6,7 +6,12 @@ "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", - "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] }, "interface" : "defaultInterface" } ], @@ -67,7 +72,12 @@ "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", - "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] }, "interface" : "defaultInterface" } ], diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/submodelDescriptor.json index 8b272ea37..3e7c79652 100644 --- a/dataformat-json/src/test/resources/submodelDescriptor.json +++ b/dataformat-json/src/test/resources/submodelDescriptor.json @@ -6,7 +6,12 @@ "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], "subprotocol" : "defaultSubprotocol", "subprotocolBody" : "defaultSubprotocolBody", - "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding" + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] }, "interface" : "defaultInterface" } ], From 7c74c95077b2fbf73e320b3e8187f6c54438527e Mon Sep 17 00:00:00 2001 From: Sebastian Bader Date: Tue, 12 Dec 2023 15:04:43 +0100 Subject: [PATCH 47/91] remove unnecessary roundtrips in the json deserializer --- .../aas4j/v3/dataformat/json/JsonDeserializer.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index dabc8fe57..e90c39ec3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -68,8 +68,6 @@ public JsonDeserializer() { */ public Environment read(String value) throws DeserializationException { try { - // the new schema (version 3.0.RC02) defines modelType as a string, therefore the ModelTypeProcessor is not needed anymore - //return mapper.treeToValue(ModelTypeProcessor.preprocess(value), Environment.class); return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); @@ -360,8 +358,7 @@ public Reference readReference(String reference) throws DeserializationException public List readReferences(String references) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(references)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(references,new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of References", ex); } @@ -378,8 +375,7 @@ public SpecificAssetId readSpecificAssetId(String specificAssetId) throws Deseri public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(specificAssetIds)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(specificAssetIds,new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } @@ -395,8 +391,7 @@ public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) thro public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(submodelDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(submodelDescriptors,new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); } From 4203e17bc6383a464ff5e6ef2c080f431e56b40c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 15 Jan 2024 16:34:31 +0100 Subject: [PATCH 48/91] Rename EnumSerializer to AasEnumSerializer This is needed to avoid the conflict with the same class from Jackson library. Due to this conflict the IDE is showing compilation errors, even when the build from the command line works properly. --- ...EnumDeserializer.java => AasEnumDeserializer.java} | 5 +++-- .../{EnumSerializer.java => AasEnumSerializer.java} | 4 ++-- .../aas4j/v3/dataformat/core/util/AasUtils.java | 11 ++++++----- .../v3/dataformat/core/EnumDeserializerTest.java | 10 +++++----- .../aas4j/v3/dataformat/core/EnumSerializerTest.java | 6 +++--- .../aas4j/v3/dataformat/json/JsonMapperFactory.java | 9 +++++---- .../aas4j/v3/dataformat/xml/XmlDeserializer.java | 5 +++-- .../aas4j/v3/dataformat/xml/XmlSerializer.java | 7 ++++--- .../xml/mixins/DataSpecificationIec61360Mixin.java | 5 +++-- 9 files changed, 34 insertions(+), 28 deletions(-) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/{EnumDeserializer.java => AasEnumDeserializer.java} (91%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/{EnumSerializer.java => AasEnumSerializer.java} (96%) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java similarity index 91% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java index ebd49fbff..9153c90bd 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,11 +29,11 @@ * * @param Type of enum to deserialize */ -public class EnumDeserializer> extends JsonDeserializer { +public class AasEnumDeserializer> extends JsonDeserializer { protected final Class type; - public EnumDeserializer(Class type) { + public AasEnumDeserializer(Class type) { this.type = type; } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java similarity index 96% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java index 190d8c886..abc7d8f6a 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ * serialization will be used */ @SuppressWarnings("rawtypes") -public class EnumSerializer extends JsonSerializer { +public class AasEnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 1621c2c92..15283d875 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +17,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; @@ -71,7 +72,7 @@ private static String asString(Reference reference) { return null; } return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + reference.getKeys().stream().map(x -> String.format("(%s)%s", AasEnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); } /** @@ -116,7 +117,7 @@ public static Reference toReference(Identifiable identifiable) { public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(AasEnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); } return null; } @@ -130,7 +131,7 @@ public static KeyTypes referableToKeyType(Referable referable) { */ private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(AasEnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 93ddbd6cf..32868688f 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -42,18 +42,18 @@ public void setUp() { @Test public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); + Assert.assertEquals("ANY_ENUM", AasEnumDeserializer.deserializeEnumName("AnyEnum")); } @Test public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); + Assert.assertEquals("ANY_ENUM", AasEnumDeserializer.deserializeEnumName("anyEnum")); } @Test public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { final String name = "ANY_ENUM"; - Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); + Assert.assertEquals(name, AasEnumDeserializer.deserializeEnumName(name)); } @Test @@ -91,7 +91,7 @@ private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); - EnumDeserializer enumDeserializer = new EnumDeserializer<>(type); + AasEnumDeserializer enumDeserializer = new AasEnumDeserializer<>(type); Enum actual = enumDeserializer.deserialize(jsonParserMock, deserializationContextMock); Assert.assertEquals(expected, actual); } catch (IOException ex) { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 33cae0017..635e7de27 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; @@ -34,7 +34,7 @@ public class EnumSerializerTest { private JsonGenerator jsonGeneratorMock; private SerializerProvider serializerProviderMock; - private EnumSerializer enumSerializer; + private AasEnumSerializer enumSerializer; private StringBuffer serializationOutput; @Before @@ -47,7 +47,7 @@ public void setUp() throws Exception { return null; }).when(jsonGeneratorMock).writeString(Mockito.anyString()); serializerProviderMock = Mockito.mock(SerializerProvider.class); - this.enumSerializer = new EnumSerializer(); + this.enumSerializer = new AasEnumSerializer(); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index 99431bc39..fe0d52932 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +24,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper.Builder; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -65,8 +66,8 @@ protected SimpleModule buildImplementationModule(SimpleAbstractTypeResolver type protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new EnumSerializer())); - ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); + ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new AasEnumSerializer())); + ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new AasEnumDeserializer<>(x))); return module; } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index 38965664a..f1ed3bc29 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +25,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; @@ -93,7 +94,7 @@ private void initTypeResolver() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); + ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new AasEnumDeserializer<>(x))); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index eda8f98f7..ad1c42a08 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,6 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,7 +26,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; @@ -93,7 +94,7 @@ protected SimpleModule buildCustomSerializerModule() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - module.addSerializer(Enum.class, new EnumSerializer()); + module.addSerializer(Enum.class, new AasEnumSerializer()); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 64cf17940..c93865237 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; @@ -97,7 +98,7 @@ public interface DataSpecificationIec61360Mixin { public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") - @JsonSerialize(using = EnumSerializer.class) + @JsonSerialize(using = AasEnumSerializer.class) public DataTypeIec61360 getDataType(); } From 7a2b5f17e48f3b8a2d3ce9d3c789afa3c3ec062b Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 16 Jan 2024 09:55:04 +0100 Subject: [PATCH 49/91] Restore the old state --- ...Deserializer.java => EnumDeserializer.java} | 4 ++-- ...EnumSerializer.java => EnumSerializer.java} | 2 +- .../v3/dataformat/core/util/AasUtils.java | 10 +++++----- .../dataformat/core/EnumDeserializerTest.java | 10 +++++----- .../v3/dataformat/core/EnumSerializerTest.java | 6 +++--- .../v3/dataformat/json/JsonDeserializer.java | 18 ++++++++++++------ .../v3/dataformat/json/JsonMapperFactory.java | 8 ++++---- .../v3/dataformat/xml/XmlDeserializer.java | 4 ++-- .../aas4j/v3/dataformat/xml/XmlSerializer.java | 6 +++--- .../mixins/DataSpecificationIec61360Mixin.java | 4 ++-- 10 files changed, 39 insertions(+), 33 deletions(-) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/{AasEnumDeserializer.java => EnumDeserializer.java} (94%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/{AasEnumSerializer.java => EnumSerializer.java} (98%) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java similarity index 94% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index 9153c90bd..767d3b7ae 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/AasEnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -29,11 +29,11 @@ * * @param Type of enum to deserialize */ -public class AasEnumDeserializer> extends JsonDeserializer { +public class EnumDeserializer> extends JsonDeserializer { protected final Class type; - public AasEnumDeserializer(Class type) { + public EnumDeserializer(Class type) { this.type = type; } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java similarity index 98% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index abc7d8f6a..881e87141 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -34,7 +34,7 @@ * serialization will be used */ @SuppressWarnings("rawtypes") -public class AasEnumSerializer extends JsonSerializer { +public class EnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 15283d875..bbc85c6c1 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -17,10 +17,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; import com.google.common.reflect.TypeToken; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; @@ -72,7 +72,7 @@ private static String asString(Reference reference) { return null; } return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", AasEnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); } /** @@ -117,7 +117,7 @@ public static Reference toReference(Identifiable identifiable) { public static KeyTypes referableToKeyType(Referable referable) { Class aasInterface = ReflectionHelper.getAasInterface(referable.getClass()); if (aasInterface != null) { - return KeyTypes.valueOf(AasEnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); + return KeyTypes.valueOf(EnumDeserializer.deserializeEnumName(aasInterface.getSimpleName())); } return null; } @@ -131,7 +131,7 @@ public static KeyTypes referableToKeyType(Referable referable) { */ private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(AasEnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 32868688f..93ddbd6cf 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; @@ -42,18 +42,18 @@ public void setUp() { @Test public void whenDeserializingEnumNames_withUpperCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasEnumDeserializer.deserializeEnumName("AnyEnum")); + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("AnyEnum")); } @Test public void whenDeserializingEnumNames_withLowerCamelCase_shouldReturnScreamingSnakeCase() { - Assert.assertEquals("ANY_ENUM", AasEnumDeserializer.deserializeEnumName("anyEnum")); + Assert.assertEquals("ANY_ENUM", EnumDeserializer.deserializeEnumName("anyEnum")); } @Test public void whenDeserializingEnumNames_withScreamingSnakeCase_shouldReturnUnchanged() { final String name = "ANY_ENUM"; - Assert.assertEquals(name, AasEnumDeserializer.deserializeEnumName(name)); + Assert.assertEquals(name, EnumDeserializer.deserializeEnumName(name)); } @Test @@ -91,7 +91,7 @@ private void assertDeserialization(String value, Enum expected) { try { Mockito.doReturn(value).when(jsonParserMock).getText(); Class type = expected.getClass(); - AasEnumDeserializer enumDeserializer = new AasEnumDeserializer<>(type); + EnumDeserializer enumDeserializer = new EnumDeserializer<>(type); Enum actual = enumDeserializer.deserialize(jsonParserMock, deserializationContextMock); Assert.assertEquals(expected, actual); } catch (IOException ex) { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 635e7de27..33cae0017 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; @@ -34,7 +34,7 @@ public class EnumSerializerTest { private JsonGenerator jsonGeneratorMock; private SerializerProvider serializerProviderMock; - private AasEnumSerializer enumSerializer; + private EnumSerializer enumSerializer; private StringBuffer serializationOutput; @Before @@ -47,7 +47,7 @@ public void setUp() throws Exception { return null; }).when(jsonGeneratorMock).writeString(Mockito.anyString()); serializerProviderMock = Mockito.mock(SerializerProvider.class); - this.enumSerializer = new AasEnumSerializer(); + this.enumSerializer = new EnumSerializer(); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index e90c39ec3..346075cbf 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -34,6 +34,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; @@ -68,7 +69,7 @@ public JsonDeserializer() { */ public Environment read(String value) throws DeserializationException { try { - return mapper.treeToValue(new ObjectMapper().readTree(value), Environment.class); + return mapper.readValue(value, Environment.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); } @@ -97,7 +98,11 @@ public Environment read(JsonNode root) throws DeserializationException { * @throws DeserializationException if deserialization fails */ public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); + try { + return mapper.readValue(new InputStreamReader(src, DEFAULT_CHARSET), Environment.class); + } catch (IOException e) { + throw new RuntimeException(e); + } } /** @@ -109,10 +114,11 @@ public Environment read(InputStream src) throws DeserializationException { * @throws DeserializationException if deserialization fails */ public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); + try { + return mapper.readValue(new InputStreamReader(src, charset), Environment.class); + } catch (IOException ex) { + throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); + } } /** diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index fe0d52932..5cac6ae39 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -24,8 +24,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper.Builder; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -66,8 +66,8 @@ protected SimpleModule buildImplementationModule(SimpleAbstractTypeResolver type protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new AasEnumSerializer())); - ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new AasEnumDeserializer<>(x))); + ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new EnumSerializer())); + ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); return module; } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index f1ed3bc29..ed4a8d646 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.AasEnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; @@ -94,7 +94,7 @@ private void initTypeResolver() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new AasEnumDeserializer<>(x))); + ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index ad1c42a08..8a7aa5a7c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,7 +1,7 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -26,7 +26,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; @@ -94,7 +94,7 @@ protected SimpleModule buildCustomSerializerModule() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - module.addSerializer(Enum.class, new AasEnumSerializer()); + module.addSerializer(Enum.class, new EnumSerializer()); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index c93865237..649768729 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; @@ -98,7 +98,7 @@ public interface DataSpecificationIec61360Mixin { public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") - @JsonSerialize(using = AasEnumSerializer.class) + @JsonSerialize(using = EnumSerializer.class) public DataTypeIec61360 getDataType(); } From 45a6680093202dff0170e1376f1986e553fa95a4 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 16 Jan 2024 13:48:31 +0100 Subject: [PATCH 50/91] Add some more tests --- ...Serializer.java => AasEnumSerializer.java} | 2 +- .../v3/dataformat/core/util/AasUtils.java | 6 +-- .../dataformat/core/EnumSerializerTest.java | 6 +-- .../v3/dataformat/json/JsonDeserializer.java | 43 ++++++++----------- .../v3/dataformat/json/JsonMapperFactory.java | 4 +- .../dataformat/json/JsonDeserializerTest.java | 27 +++++++++++- .../v3/dataformat/xml/XmlSerializer.java | 4 +- .../DataSpecificationIec61360Mixin.java | 4 +- 8 files changed, 58 insertions(+), 38 deletions(-) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/{EnumSerializer.java => AasEnumSerializer.java} (98%) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java similarity index 98% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java index 881e87141..abc7d8f6a 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java @@ -34,7 +34,7 @@ * serialization will be used */ @SuppressWarnings("rawtypes") -public class EnumSerializer extends JsonSerializer { +public class AasEnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index bbc85c6c1..dffa20653 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -20,7 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; @@ -72,7 +72,7 @@ private static String asString(Reference reference) { return null; } return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + reference.getKeys().stream().map(x -> String.format("(%s)%s", AasEnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); } /** @@ -131,7 +131,7 @@ public static KeyTypes referableToKeyType(Referable referable) { */ private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 33cae0017..635e7de27 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; @@ -34,7 +34,7 @@ public class EnumSerializerTest { private JsonGenerator jsonGeneratorMock; private SerializerProvider serializerProviderMock; - private EnumSerializer enumSerializer; + private AasEnumSerializer enumSerializer; private StringBuffer serializationOutput; @Before @@ -47,7 +47,7 @@ public void setUp() throws Exception { return null; }).when(jsonGeneratorMock).writeString(Mockito.anyString()); serializerProviderMock = Mockito.mock(SerializerProvider.class); - this.enumSerializer = new EnumSerializer(); + this.enumSerializer = new AasEnumSerializer(); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 346075cbf..bda590a74 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -98,11 +98,7 @@ public Environment read(JsonNode root) throws DeserializationException { * @throws DeserializationException if deserialization fails */ public Environment read(InputStream src) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(src, DEFAULT_CHARSET), Environment.class); - } catch (IOException e) { - throw new RuntimeException(e); - } + return read(src, DEFAULT_CHARSET); } /** @@ -131,7 +127,7 @@ public Environment read(InputStream src, Charset charset) throws Deserialization * @throws DeserializationException if deserialization fails */ public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { + throws FileNotFoundException, DeserializationException { return read(new FileInputStream(file), charset); } @@ -223,11 +219,11 @@ public T readReferable(JsonNode root, Class outputClass * @throws DeserializationException if deserialization fails */ public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + try { + return mapper.readValue(new InputStreamReader(src, charset), outputClass); + } catch (IOException ex) { + throw new DeserializationException("error deserializing Referable", ex); + } } /** @@ -318,11 +314,11 @@ public List readReferables(InputStream src, Class ou * @throws DeserializationException if deserialization fails */ public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + try { + return mapper.readValue(new InputStreamReader(src, charset), mapper.getTypeFactory().constructCollectionLikeType(List.class, outputClass)); + } catch (IOException e) { + throw new RuntimeException(e); + } } /** @@ -356,7 +352,7 @@ public List readReferables(File src, Charset charset, C public Reference readReference(String reference) throws DeserializationException { try { - return mapper.treeToValue(new ObjectMapper().readTree(reference), Reference.class); + return mapper.readValue(reference, Reference.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing the Reference", ex); } @@ -373,7 +369,7 @@ public List readReferences(String references) throws DeserializationE public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { try { - return mapper.treeToValue(new ObjectMapper().readTree(specificAssetId), SpecificAssetId.class); + return mapper.readValue(specificAssetId, SpecificAssetId.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing the SpecificAssetId", ex); } @@ -381,7 +377,7 @@ public SpecificAssetId readSpecificAssetId(String specificAssetId) throws Deseri public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { try { - return mapper.readValue(specificAssetIds,new TypeReference>(){}); + return mapper.readValue(specificAssetIds, new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); } @@ -389,7 +385,7 @@ public List readSpecificAssetIds(String specificAssetIds) throw public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { try { - return mapper.treeToValue(new ObjectMapper().readTree(submodelDescriptor), SubmodelDescriptor.class); + return mapper.readValue(submodelDescriptor, SubmodelDescriptor.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); } @@ -397,7 +393,7 @@ public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) thro public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { try { - return mapper.readValue(submodelDescriptors,new TypeReference>(){}); + return mapper.readValue(submodelDescriptors, new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); } @@ -405,7 +401,7 @@ public List readSubmodelDescriptors(String submodelDescripto public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { try { - return mapper.treeToValue(new ObjectMapper().readTree(assetAdministrationShellDescriptor), AssetAdministrationShellDescriptor.class); + return mapper.readValue(assetAdministrationShellDescriptor, AssetAdministrationShellDescriptor.class); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); } @@ -413,8 +409,7 @@ public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { try { - String parsed = mapper.writeValueAsString(new ObjectMapper().readTree(assetAdministrationShellDescriptors)) ; - return mapper.readValue(parsed,new TypeReference>(){}); + return mapper.readValue(assetAdministrationShellDescriptors, new TypeReference>(){}); } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index 5cac6ae39..09394aa57 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -66,7 +66,7 @@ protected SimpleModule buildImplementationModule(SimpleAbstractTypeResolver type protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new EnumSerializer())); + ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new AasEnumSerializer())); ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); return module; } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index b4f819499..83e4068f1 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -30,15 +30,40 @@ import org.junit.Assert; import org.junit.Test; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { @Test - public void testReadFromFile() throws Exception { + public void testReadFromStream() throws Exception { new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); } + @Test + public void testReadFromFile() throws Exception { + File file = Paths.get("src", "test", "resources", "Example-Full.json").toFile(); + assertTrue(file.exists()); + Environment env = new JsonDeserializer().read(file); + assertNotNull(env); + } + + + @Test + public void testReadReferable() throws Exception { + Path path = Paths.get("src", "test", "resources", "Submodel.json"); + assertTrue(path.toFile().exists()); + String jsonSubmodel = Files.readString(path); + Submodel submodel = new JsonDeserializer().readReferable(jsonSubmodel, Submodel.class); + assertNotNull(submodel); + } + @Test public void testSimpleExample() throws Exception { Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index 8a7aa5a7c..865af32a1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; @@ -94,7 +94,7 @@ protected SimpleModule buildCustomSerializerModule() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - module.addSerializer(Enum.class, new EnumSerializer()); + module.addSerializer(Enum.class, new AasEnumSerializer()); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 649768729..c93865237 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; @@ -98,7 +98,7 @@ public interface DataSpecificationIec61360Mixin { public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") - @JsonSerialize(using = EnumSerializer.class) + @JsonSerialize(using = AasEnumSerializer.class) public DataTypeIec61360 getDataType(); } From 816327e54cd07c94a151cb9f694296c0b65653ae Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 17 Jan 2024 11:26:34 +0100 Subject: [PATCH 51/91] Add unit tests for the JsonDeserializer --- .../v3/dataformat/json/JsonDeserializer.java | 351 +++++++++++------- ...rationShellDescriptorDeserializerTest.java | 13 +- .../dataformat/json/JsonDeserializerTest.java | 80 +++- .../json/JsonReferenceDeserializerTest.java | 12 +- ...sonSubmodelDescriptorDeserializerTest.java | 12 +- ...> AssetAdministrationShellDescriptor.json} | 0 ...escriptor.json => SubmodelDescriptor.json} | 0 7 files changed, 321 insertions(+), 147 deletions(-) rename dataformat-json/src/test/resources/{assetAdministrationShellDescriptor.json => AssetAdministrationShellDescriptor.json} (100%) rename dataformat-json/src/test/resources/{submodelDescriptor.json => SubmodelDescriptor.json} (100%) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index bda590a74..710b7c4d1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -17,9 +17,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; @@ -30,7 +28,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -40,14 +37,11 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; - /** * Class for deserializing/parsing AAS JSON documents. */ public class JsonDeserializer { - protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; private JsonMapperFactory jsonMapperFactory; @@ -61,40 +55,137 @@ public JsonDeserializer() { } /** - * Deserializes a given string into an instance of AssetAdministrationShellEnvironment + * Deserializes a given string into instance of an AAS type * - * @param value a string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment + * @param value a string representation of the AAS instance + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return the instance * @throws DeserializationException if deserialization fails */ - public Environment read(String value) throws DeserializationException { + public T read(String value, Class valueType) throws DeserializationException { try { - return mapper.readValue(value, Environment.class); + return mapper.readValue(value, valueType); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); + throw new DeserializationException("error deserializing "+ valueType.getSimpleName(), ex); } } /** - * Deserializes a given JSON node into an instance of AssetAdministrationShellEnvironment + * Deserializes a given JSON node into instance of an AAS type + * + * @param node the node to parse + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return an AAS instance * - * @param root root node of the document to parse - * @return an instance of AssetAdministrationShellEnvironment * @throws DeserializationException if deserialization fails */ - public Environment read(JsonNode root) throws DeserializationException { + public T read(JsonNode node, Class valueType) throws DeserializationException { + try { + return mapper.treeToValue(node, valueType); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } + } + + /** + * Deserializes a given InputStream into instance of an AAS type, using a given charset + * + * @param stream An InputStream containing the string representation of the AAS instance + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return an AAS instance + * @throws DeserializationException if deserialization fails + */ + public T read(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + try { + return mapper.readValue(new InputStreamReader(stream, charset), valueType); + } catch (IOException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } + } + + /** + * Deserializes a given string into a list of AAS instances + * + * @param value a string representation of the AAS instances list + * @param valueType the class type of the instance + * @param the AAS type + * @return a list of AAS instances + * @throws DeserializationException if deserialization fails + */ + public List readList(String value, Class valueType) throws DeserializationException { + try { + return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } + } + + /** + * Deserializes a given JsonArray into a list of AAS instances + * + * @param node a JsonArray representing the AAS instances list + * @param valueType the class type of the instance + * @param the AAS type + * @return a list of AAS instances + * @throws DeserializationException if deserialization fails + */ + public List readList(JsonNode node, Class valueType) throws DeserializationException { try { - return mapper.treeToValue(root, Environment.class); + return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given InputStream into an instance of AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * Deserializes a given input stream into a list of AAS instances * - * @param src an InputStream containing the string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment + * @param stream An InputStream containing the string representation of the AAS instances list + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return a list of AAS instances + * @throws DeserializationException if deserialization fails + */ + public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + try { + return mapper.readValue(new InputStreamReader(stream, charset), + mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (Exception ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } + } + + /** + * Deserializes a given string into an instance of AAS environment + * + * @param value a string representation of the AAS environment + * @return an instance of AAS environment + * @throws DeserializationException if deserialization fails + */ + public Environment read(String value) throws DeserializationException { + return read(value, Environment.class); + } + + /** + * Deserializes a given JSON node into an instance of AAS environment + * @param root root node of the document to parse + * @return an instance of AAS environment + * @throws DeserializationException if deserialization fails + */ + public Environment read(JsonNode root) throws DeserializationException { + return read(root, Environment.class); + } + + /** + * Deserializes a given InputStream into an instance of AAS environment using DEFAULT_CHARSET + * + * @param src an InputStream containing the string representation of the AAS environment + * @return an instance of AAS environment * @throws DeserializationException if deserialization fails */ public Environment read(InputStream src) throws DeserializationException { @@ -102,55 +193,49 @@ public Environment read(InputStream src) throws DeserializationException { } /** - * Deserializes a given InputStream into an instance of AssetAdministrationShellEnvironment using a given charset + * Deserializes a given InputStream into an instance of AAS environment using a given charset * - * @param src An InputStream containing the string representation of the AssetAdministrationShellEnvironment + * @param src An InputStream containing the string representation of the AAS environment * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment + * @return an instance of AAS environment * @throws DeserializationException if deserialization fails */ public Environment read(InputStream src, Charset charset) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(src, charset), Environment.class); - } catch (IOException ex) { - throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); - } + return read(src, charset, Environment.class); } /** - * Deserializes a given File into an instance of AssetAdministrationShellEnvironment using DEFAULT_CHARSET + * Deserializes a given File into an instance of AAS environment * - * @param file A java.io.File containing the string representation of the AssetAdministrationShellEnvironment + * @param file A java.io.File containing the string representation of the AAS environment * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment + * @return an instance of AAS environment * @throws FileNotFoundException if file is not present * @throws DeserializationException if deserialization fails */ - public Environment read(java.io.File file, Charset charset) + public Environment read(File file, Charset charset) throws FileNotFoundException, DeserializationException { return read(new FileInputStream(file), charset); } /** - * Deserializes a given File into an instance of AssetAdministrationShellEnvironment using a given charset + * Deserializes a given File into an instance of AAS environment using a given charset * - * @param file a java.io.File containing the string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment + * @param file a java.io.File containing the string representation of the AAS environment + * @return an instance of AAS environment * @throws FileNotFoundException if the file is not present * @throws DeserializationException if deserialization fails */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { + public Environment read(File file) throws FileNotFoundException, DeserializationException { return read(file, DEFAULT_CHARSET); } - /** * Enables usage of custom implementation to be used for deserialization instead of default implementation, e.g. - * defining a custom implementation of the Submodel interface {@code class - * CustomSubmodel implements Submodel {}} and calling - * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will result in all instances of Submodel will be - * deserialized as CustomSubmodel. Subsequent class with the same aasInterface parameter will override the effects - * of all previous calls. + * defining a custom implementation of the Submodel interface {@code class CustomSubmodel implements Submodel {}} + * and calling {@code useImplementation(Submodel.class, CustomSubmodel.class);} will result in all instances of + * Submodel will be deserialized as CustomSubmodel. Subsequent class with the same aasInterface parameter will + * override the effects of all previous calls. * * @param the type of the interface to replace * @param aasInterface the class of the interface to replace @@ -171,11 +256,7 @@ public void useImplementation(Class aasInterface, Class impl * @throws DeserializationException if deserialization fails */ public T readReferable(String src, Class outputClass) throws DeserializationException { - try { - return mapper.readValue(src, outputClass); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing Referable", ex); - } + return read(src, outputClass); } /** @@ -187,7 +268,8 @@ public T readReferable(String src, Class outputClass) t * @return an instance of the referable * @throws DeserializationException if deserialization fails */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { + public T readReferable(InputStream src, Class outputClass) + throws DeserializationException { return readReferable(src, DEFAULT_CHARSET, outputClass); } @@ -201,11 +283,7 @@ public T readReferable(InputStream src, Class outputCla * @throws DeserializationException if deserialization fails */ public T readReferable(JsonNode root, Class outputClass) throws DeserializationException { - try { - return mapper.treeToValue(root, outputClass); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing Referable", ex); - } + return read(root, outputClass); } /** @@ -218,12 +296,9 @@ public T readReferable(JsonNode root, Class outputClass * @return an instance of the referable * @throws DeserializationException if deserialization fails */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(src, charset), outputClass); - } catch (IOException ex) { - throw new DeserializationException("error deserializing Referable", ex); - } + public T readReferable(InputStream src, Charset charset, Class outputClass) + throws DeserializationException { + return read(src, charset, outputClass); } /** @@ -236,7 +311,8 @@ public T readReferable(InputStream src, Charset charset, C * @throws DeserializationException if deserialization fails * @throws java.io.FileNotFoundException if file is not found */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + public T readReferable(File src, Class outputClass) + throws DeserializationException, FileNotFoundException { return readReferable(src, DEFAULT_CHARSET, outputClass); } @@ -251,7 +327,8 @@ public T readReferable(File src, Class outputClass) thr * @throws DeserializationException if deserialization fails * @throws java.io.FileNotFoundException if file is not found */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { + public T readReferable(File src, Charset charset, Class outputClass) + throws DeserializationException, FileNotFoundException { return readReferable(new FileInputStream(src), charset, outputClass); } @@ -264,13 +341,9 @@ public T readReferable(File src, Charset charset, Class * @return an instance of a list of the referables * @throws DeserializationException if deserialization of referable fails */ - public List readReferables(String referables, Class outputClass) throws DeserializationException { - try { - return mapper.readValue(referables, new TypeReference>() { - }); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); - } + public List readReferables(String referables, Class outputClass) + throws DeserializationException { + return readList(referables, outputClass); } /** @@ -282,12 +355,9 @@ public List readReferables(String referables, Class * @return an instance of a list of the referables * @throws DeserializationException if deserialization of referable fails */ - public List readReferables(JsonNode root, Class outputClass) throws DeserializationException { - try { - return mapper.treeToValue(root, mapper.getTypeFactory().constructCollectionLikeType(List.class, outputClass)); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); - } + public List readReferables(JsonNode root, Class outputClass) + throws DeserializationException { + return readList(root, outputClass); } /** @@ -299,7 +369,8 @@ public List readReferables(JsonNode root, Class outp * @return an instance of the referable * @throws DeserializationException if deserialization fails */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { + public List readReferables(InputStream src, Class outputClass) + throws DeserializationException { return readReferables(src, DEFAULT_CHARSET, outputClass); } @@ -313,12 +384,9 @@ public List readReferables(InputStream src, Class ou * @return an instance of the referable * @throws DeserializationException if deserialization fails */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(src, charset), mapper.getTypeFactory().constructCollectionLikeType(List.class, outputClass)); - } catch (IOException e) { - throw new RuntimeException(e); - } + public List readReferables(InputStream src, Charset charset, Class outputClass) + throws DeserializationException { + return readList(src, charset, outputClass); } /** @@ -331,7 +399,8 @@ public List readReferables(InputStream src, Charset cha * @throws DeserializationException if deserialization fails * @throws java.io.FileNotFoundException if file is not found */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { + public List readReferables(File src, Class outputClass) + throws DeserializationException, FileNotFoundException { return readReferables(src, DEFAULT_CHARSET, outputClass); } @@ -346,72 +415,98 @@ public List readReferables(File src, Class outputCla * @throws DeserializationException if deserialization fails * @throws java.io.FileNotFoundException if file is not found */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + public List readReferables(File src, Charset charset, Class outputClass) + throws DeserializationException, FileNotFoundException { + return readList(new FileInputStream(src), charset, outputClass); } + /** + * Deserializes a given string into an instance of an AAS reference + * + * @param reference a string representation of an AAS reference + * @return an instance of the AAS reference + * @throws DeserializationException if deserialization fails + */ public Reference readReference(String reference) throws DeserializationException { - try { - return mapper.readValue(reference, Reference.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the Reference", ex); - } + return read(reference, Reference.class); } + /** + * Deserializes a given string into a list of AAS references + * + * @param references a string representation of the AAS references list + * @return a list of AAS references + * @throws DeserializationException if deserialization fails + */ public List readReferences(String references) throws DeserializationException { - try { - return mapper.readValue(references,new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of References", ex); - } + return readList(references, Reference.class); } - + /** + * Deserializes a given string into an instance of an AAS specific asset ID + * + * @param specificAssetId a string representation of an AAS specific asset ID + * @return an instance of the AAS specific asset ID + * @throws DeserializationException if deserialization fails + */ public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { - try { - return mapper.readValue(specificAssetId, SpecificAssetId.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SpecificAssetId", ex); - } + return read(specificAssetId, SpecificAssetId.class); } + /** + * Deserializes a given string into a list of AAS references + * + * @param specificAssetIds a string representation of the AAS specific asset IDs + * @return a list of AAS specific asset IDs + * @throws DeserializationException if deserialization fails + */ public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { - try { - return mapper.readValue(specificAssetIds, new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SpecificAssetIds", ex); - } + return readList(specificAssetIds, SpecificAssetId.class); } + /** + * Deserializes a given string into an AAS submodel descriptor + * + * @param submodelDescriptor a string representation of the AAS submodel descriptor + * @return an instance of AAS submodel descriptor + * @throws DeserializationException if deserialization fails + */ public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { - try { - return mapper.readValue(submodelDescriptor, SubmodelDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the SubmodelDescriptor", ex); - } + return read(submodelDescriptor, SubmodelDescriptor.class); } + /** + * Deserializes a given string into a list of AAS submodel descriptors + * + * @param submodelDescriptors a string representation of the submodel descriptors + * @return a list of AAS submodel descriptors + * @throws DeserializationException if deserialization fails + */ public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { - try { - return mapper.readValue(submodelDescriptors, new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of SubmodelDescriptors", ex); - } + return readList(submodelDescriptors, SubmodelDescriptor.class); } - public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String assetAdministrationShellDescriptor) throws DeserializationException { - try { - return mapper.readValue(assetAdministrationShellDescriptor, AssetAdministrationShellDescriptor.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing the AssetAdministrationShellDescriptor", ex); - } + /** + * Deserializes a given string into an AAS submodel descriptor + * + * @param shellDescriptor a string representation of the AAS shell descriptor + * @return an instance of AAS shell descriptor + * @throws DeserializationException if deserialization fails + */ + public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String shellDescriptor) + throws DeserializationException { + return read(shellDescriptor, AssetAdministrationShellDescriptor.class); } - public List readAssetAdministrationShellDescriptors(String assetAdministrationShellDescriptors) throws DeserializationException { - try { - return mapper.readValue(assetAdministrationShellDescriptors, new TypeReference>(){}); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of AssetAdministrationShellDescriptors", ex); - } + /** + * Deserializes a given string into a list of AAS shell descriptors + * + * @param shellDescriptors a string representation of the AAS shell descriptors + * @return a list of AAS shell descriptors + * @throws DeserializationException if deserialization fails + */ + public List readAssetAdministrationShellDescriptors(String shellDescriptors) + throws DeserializationException { + return readList(shellDescriptors, AssetAdministrationShellDescriptor.class); } } \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index ebcc2fbd7..aa6c4dcb9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -63,7 +63,7 @@ public static AssetAdministrationShellDescriptor createAasDescriptor() { @Test public void testReadAasDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new JsonDeserializer().readAssetAdministrationShellDescriptor(expected); AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); @@ -71,4 +71,15 @@ public void testReadAasDescriptor() throws IOException, DeserializationException assertEquals(aasExpected, assetAdministrationShellDescriptor); } + + @Test + public void testReadAasDescriptorsList() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); + String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; + List assetAdministrationShellDescriptors = + new JsonDeserializer().readAssetAdministrationShellDescriptors(expected); + AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); + + assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 83e4068f1..9dc6a5a52 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -14,7 +14,6 @@ * limitations under the License. */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; @@ -22,8 +21,10 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; @@ -31,30 +32,31 @@ import org.junit.Test; import java.io.File; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { - @Test - public void testReadFromStream() throws Exception { - new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + public void testReadEnvironmentFromStream() throws Exception { + Environment env = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + assertNotNull(env); } @Test - public void testReadFromFile() throws Exception { + public void testReadEnvironmentFromFile() throws Exception { File file = Paths.get("src", "test", "resources", "Example-Full.json").toFile(); assertTrue(file.exists()); Environment env = new JsonDeserializer().read(file); assertNotNull(env); } - @Test public void testReadReferable() throws Exception { Path path = Paths.get("src", "test", "resources", "Submodel.json"); @@ -64,6 +66,72 @@ public void testReadReferable() throws Exception { assertNotNull(submodel); } + @Test + public void testReadReferableFromStream() throws Exception { + Submodel submodel = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertNotNull(submodel); + } + + @Test + public void testReadReferableFromNode() throws Exception { + JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL.fileContentStream()); + Submodel submodel = new JsonDeserializer().readReferable(node, Submodel.class); + assertNotNull(submodel); + } + + @Test + public void testReadReferableFromFile() throws Exception { + File file = Paths.get("src", "test", "resources", "Submodel.json").toFile(); + assertTrue(file.exists()); + Submodel submodel = new JsonDeserializer().readReferable(file, Submodel.class); + assertNotNull(submodel); + } + + @Test + public void testReadReferables() throws Exception { + Path path = Paths.get("src", "test", "resources", "Submodel-List.json"); + assertTrue(path.toFile().exists()); + String jsonSubmodels = Files.readString(path); + List submodels = new JsonDeserializer().readReferables(jsonSubmodels, Submodel.class); + assertNotNull(submodels); + assertEquals(2, submodels.size()); + assertNotNull(submodels.get(0)); + assertNotNull(submodels.get(1)); + } + + @Test + public void testReadReferablesFromNode() throws Exception { + JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL_LIST_OF.fileContentStream()); + List submodels = new JsonDeserializer().readReferables(node, Submodel.class); + assertNotNull(submodels); + assertEquals(2, submodels.size()); + assertNotNull(submodels.get(0)); + assertNotNull(submodels.get(1)); + } + + @Test + public void testReadReferablesFromStream() throws Exception { + List submodels = new JsonDeserializer().readReferables( + Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertNotNull(submodels); + assertEquals(2, submodels.size()); + assertNotNull(submodels.get(0)); + assertNotNull(submodels.get(1)); + } + + @Test + public void testReadReferablesFromFile() throws Exception { + File file = Paths.get("src", "test", "resources", "Submodel-List.json").toFile(); + assertTrue(file.exists()); + List submodels = new JsonDeserializer().readReferables(file, Submodel.class); + assertNotNull(submodels); + assertEquals(2, submodels.size()); + assertNotNull(submodels.get(0)); + assertNotNull(submodels.get(1)); + } + + + @Test public void testSimpleExample() throws Exception { Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 7c7354d3b..9964fc69a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -21,22 +21,17 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; + import org.junit.Before; import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.util.List; import static org.junit.Assert.assertTrue; public class JsonReferenceDeserializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonReferenceDeserializerTest.class); - private String reference_string; private String reference_list_string; - private String valueReferencePair_string; @Before @@ -46,7 +41,6 @@ public void prepare() throws SerializationException { reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); } - @Test public void testDeserializeReference() throws DeserializationException { JsonDeserializer deserializer = new JsonDeserializer(); @@ -65,6 +59,4 @@ public void testDeserializeReferenceList() throws DeserializationException { assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); } - - -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index 3daf4d3e3..df5ab45a2 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -42,14 +42,22 @@ public static SubmodelDescriptor getDefaultSubmodelDescriptor () { .build(); } - @Test public void testReadSubmodelDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); SubmodelDescriptor submodelDescriptor = new JsonDeserializer().readSubmodelDescriptor(expected); SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptor); } + + @Test + public void testReadSubmodelDescriptors() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); + String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; + List submodelDescriptors = new JsonDeserializer().readSubmodelDescriptors(expected); + SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); + } } diff --git a/dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json similarity index 100% rename from dataformat-json/src/test/resources/assetAdministrationShellDescriptor.json rename to dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json diff --git a/dataformat-json/src/test/resources/submodelDescriptor.json b/dataformat-json/src/test/resources/SubmodelDescriptor.json similarity index 100% rename from dataformat-json/src/test/resources/submodelDescriptor.json rename to dataformat-json/src/test/resources/SubmodelDescriptor.json From cbfc4d24e66205714f310eb7bfa4ed4c8c3a4f9b Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 18 Jan 2024 09:44:25 +0100 Subject: [PATCH 52/91] Rename EnumSerializer --- .../{AasEnumSerializer.java => EnumSerializer.java} | 2 +- .../digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java | 6 +++--- .../aas4j/v3/dataformat/core/EnumSerializerTest.java | 6 +++--- .../aas4j/v3/dataformat/json/JsonMapperFactory.java | 4 ++-- .../digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java | 4 ++-- .../xml/mixins/DataSpecificationIec61360Mixin.java | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/{AasEnumSerializer.java => EnumSerializer.java} (98%) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java similarity index 98% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index abc7d8f6a..881e87141 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/AasEnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -34,7 +34,7 @@ * serialization will be used */ @SuppressWarnings("rawtypes") -public class AasEnumSerializer extends JsonSerializer { +public class EnumSerializer extends JsonSerializer { @Override public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider) throws IOException { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index dffa20653..bbc85c6c1 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -20,7 +20,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; @@ -72,7 +72,7 @@ private static String asString(Reference reference) { return null; } return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", AasEnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); + reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); } /** @@ -131,7 +131,7 @@ public static KeyTypes referableToKeyType(Referable referable) { */ private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 635e7de27..33cae0017 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; @@ -34,7 +34,7 @@ public class EnumSerializerTest { private JsonGenerator jsonGeneratorMock; private SerializerProvider serializerProviderMock; - private AasEnumSerializer enumSerializer; + private EnumSerializer enumSerializer; private StringBuffer serializationOutput; @Before @@ -47,7 +47,7 @@ public void setUp() throws Exception { return null; }).when(jsonGeneratorMock).writeString(Mockito.anyString()); serializerProviderMock = Mockito.mock(SerializerProvider.class); - this.enumSerializer = new AasEnumSerializer(); + this.enumSerializer = new EnumSerializer(); } @Test diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index 09394aa57..5cac6ae39 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; @@ -66,7 +66,7 @@ protected SimpleModule buildImplementationModule(SimpleAbstractTypeResolver type protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new AasEnumSerializer())); + ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new EnumSerializer())); ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index 865af32a1..8a7aa5a7c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -26,7 +26,7 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; @@ -94,7 +94,7 @@ protected SimpleModule buildCustomSerializerModule() { protected SimpleModule buildEnumModule() { SimpleModule module = new SimpleModule(); - module.addSerializer(Enum.class, new AasEnumSerializer()); + module.addSerializer(Enum.class, new EnumSerializer()); return module; } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index c93865237..649768729 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.AasEnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; @@ -98,7 +98,7 @@ public interface DataSpecificationIec61360Mixin { public Reference getValueId(); @JacksonXmlProperty(namespace = AasXmlNamespaceContext.AAS_URI, localName = "dataType") - @JsonSerialize(using = AasEnumSerializer.class) + @JsonSerialize(using = EnumSerializer.class) public DataTypeIec61360 getDataType(); } From 150141171f643136c3ef5cf183efbda03025d528 Mon Sep 17 00:00:00 2001 From: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:53:46 +0100 Subject: [PATCH 53/91] Result of Code Generation Run (#11) * rerun the generator on part 2 classes * remove all *Metadata classes * fix outdated attributes and cardinalities * fix inheritence relations between result classes * remove class SubmodelElementAttributes * reintroduce Arrays.toString(...) for byte[] * map duration to javax.xml.datatype.Duration --- .../aas4j/v3/dataformat/core/Examples.java | 18 + .../json/JsonDurationDeserializerTest.java | 63 +++ .../AnnotatedRelationshipElementMetadata.java | 30 -- .../AssetAdministrationShellMetadata.java | 51 --- .../aas4j/v3/model/BaseOperationResult.java | 65 ++++ .../v3/model/BasicEventElementMetadata.java | 151 -------- .../aas4j/v3/model/BlobMetadata.java | 30 -- .../aas4j/v3/model/CapabilityMetadata.java | 30 -- .../aas4j/v3/model/EntityMetadata.java | 30 -- .../aas4j/v3/model/HasDataSpecification.java | 3 - .../aas4j/v3/model/HasSemantics.java | 2 - .../aas4j/v3/model/Identifiable.java | 2 - .../digitaltwin/aas4j/v3/model/Message.java | 23 +- ...{MessageType.java => MessageTypeEnum.java} | 9 +- .../model/MultiLanguagePropertyMetadata.java | 30 -- .../aas4j/v3/model/OperationHandle.java | 17 - .../aas4j/v3/model/OperationMetadata.java | 30 -- .../aas4j/v3/model/OperationRequest.java | 46 +-- .../aas4j/v3/model/OperationResult.java | 66 +--- .../aas4j/v3/model/PropertyMetadata.java | 48 --- .../aas4j/v3/model/Qualifiable.java | 2 - .../aas4j/v3/model/RangeMetadata.java | 48 --- .../digitaltwin/aas4j/v3/model/Referable.java | 1 - .../v3/model/ReferenceElementMetadata.java | 30 -- .../digitaltwin/aas4j/v3/model/Result.java | 20 +- .../v3/model/SubmodelElementAttributes.java | 60 --- .../SubmodelElementCollectionMetadata.java | 30 -- .../v3/model/SubmodelElementListMetadata.java | 105 ----- .../aas4j/v3/model/SubmodelMetadata.java | 48 --- ...tedRelationshipElementMetadataBuilder.java | 208 ---------- ...setAdministrationShellMetadataBuilder.java | 185 --------- .../builder/BaseOperationResultBuilder.java | 71 ++++ .../BasicEventElementMetadataBuilder.java | 364 ------------------ .../v3/model/builder/BlobMetadataBuilder.java | 207 ---------- .../builder/CapabilityMetadataBuilder.java | 208 ---------- .../model/builder/EntityMetadataBuilder.java | 208 ---------- .../v3/model/builder/MessageBuilder.java | 15 +- .../MultiLanguagePropertyMetadataBuilder.java | 208 ---------- .../v3/model/builder/OperationBuilder.java | 44 +-- .../model/builder/OperationHandleBuilder.java | 11 - .../builder/OperationMetadataBuilder.java | 208 ---------- .../builder/OperationRequestBuilder.java | 38 +- .../model/builder/OperationResultBuilder.java | 44 +-- .../builder/PropertyMetadataBuilder.java | 220 ----------- .../model/builder/RangeMetadataBuilder.java | 219 ----------- .../ReferenceElementMetadataBuilder.java | 208 ---------- .../aas4j/v3/model/builder/ResultBuilder.java | 11 - .../SubmodelElementAttributesBuilder.java | 208 ---------- ...modelElementCollectionMetadataBuilder.java | 208 ---------- .../SubmodelElementListMetadataBuilder.java | 254 ------------ .../builder/SubmodelMetadataBuilder.java | 231 ----------- ...tAnnotatedRelationshipElementMetadata.java | 235 ----------- ...faultAssetAdministrationShellMetadata.java | 218 ----------- .../impl/DefaultBaseOperationResult.java | 124 ++++++ .../DefaultBasicEventElementMetadata.java | 347 ----------------- .../aas4j/v3/model/impl/DefaultBlob.java | 2 +- .../v3/model/impl/DefaultBlobMetadata.java | 234 ----------- .../model/impl/DefaultCapabilityMetadata.java | 234 ----------- .../v3/model/impl/DefaultEntityMetadata.java | 234 ----------- .../v3/model/impl/DefaultEventPayload.java | 2 +- .../aas4j/v3/model/impl/DefaultMessage.java | 26 +- .../DefaultMultiLanguagePropertyMetadata.java | 235 ----------- .../v3/model/impl/DefaultOperationHandle.java | 22 +- .../model/impl/DefaultOperationMetadata.java | 234 ----------- .../model/impl/DefaultOperationRequest.java | 54 +-- .../v3/model/impl/DefaultOperationResult.java | 76 +--- .../model/impl/DefaultPropertyMetadata.java | 249 ------------ .../v3/model/impl/DefaultRangeMetadata.java | 249 ------------ .../impl/DefaultReferenceElementMetadata.java | 234 ----------- .../aas4j/v3/model/impl/DefaultResult.java | 22 +- .../DefaultSubmodelElementAttributes.java | 234 ----------- ...aultSubmodelElementCollectionMetadata.java | 235 ----------- .../DefaultSubmodelElementListMetadata.java | 299 -------------- .../model/impl/DefaultSubmodelMetadata.java | 264 ------------- 74 files changed, 527 insertions(+), 8202 deletions(-) create mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java rename model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/{MessageType.java => MessageTypeEnum.java} (89%) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index 281a2736e..38b4dc0b7 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -19,14 +19,19 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; + public class Examples { public static final Environment EXTENSION_MINIMAL = new DefaultEnvironment.Builder() @@ -78,4 +83,17 @@ public class Examples { .build()) .build()) .build(); + + public static OperationRequest OPERATION_REQUEST; + static { + try { + OPERATION_REQUEST = new DefaultOperationRequest.Builder() + .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes + .build(); + } catch (DatatypeConfigurationException e) { + OPERATION_REQUEST = new DefaultOperationRequest.Builder() + .build(); + e.printStackTrace(); + } + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java new file mode 100644 index 000000000..86b4de687 --- /dev/null +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; + +import static org.junit.Assert.assertEquals; + +public class JsonDurationDeserializerTest { + + private static final Logger logger = LoggerFactory.getLogger(JsonDurationDeserializerTest.class); + + String operationRequestString; + + @Before + public void prepare() throws SerializationException, JsonProcessingException { + + operationRequestString = new ObjectMapper().writeValueAsString(Examples.OPERATION_REQUEST); + + } + + + @Test + public void testDeserializeDuration() throws DeserializationException, DatatypeConfigurationException { + + Duration duration = DatatypeFactory.newInstance().newDurationDayTime("P0DT0H3M0S"); // three minutes + + JsonDeserializer deserializer = new JsonDeserializer(); + + OperationRequest operationRequest = deserializer.read(operationRequestString, OperationRequest.class); + + assertEquals( operationRequest.getClientTimeoutDuration() , duration); + } + + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java deleted file mode 100644 index 16661f252..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AnnotatedRelationshipElementMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAnnotatedRelationshipElementMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultAnnotatedRelationshipElementMetadata.class) -}) -public interface AnnotatedRelationshipElementMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java deleted file mode 100644 index 5a93ec5e4..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellMetadata.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellMetadata; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultAssetAdministrationShellMetadata.class) -}) -public interface AssetAdministrationShellMetadata extends Identifiable, HasDataSpecification { - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom - * - * @return Returns the List of References for the property derivedFrom. - */ - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom") - List getDerivedFrom(); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom - * - * @param derivedFroms desired value for the property derivedFrom. - */ - void setDerivedFrom(List derivedFroms); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java new file mode 100644 index 000000000..0da07e1a0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBaseOperationResult; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBaseOperationResult.class) +}) +public interface BaseOperationResult extends Result { + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/executionState + * + * @return Returns the ExecutionState for the property executionState. + */ + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/executionState") + ExecutionState getExecutionState(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/executionState + * + * @param executionState desired value for the property executionState. + */ + void setExecutionState(ExecutionState executionState); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/success + * + * @return Returns the boolean for the property success. + */ + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/success") + boolean getSuccess(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/success + * + * @param success desired value for the property success. + */ + void setSuccess(boolean success); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java deleted file mode 100644 index af89f05b4..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BasicEventElementMetadata.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBasicEventElementMetadata; - -import java.util.List; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultBasicEventElementMetadata.class) -}) -public interface BasicEventElementMetadata extends SubmodelElementAttributes { - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction - * - * @return Returns the List of Directions for the property direction. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction") - List getDirection(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction - * - * @param directions desired value for the property direction. - */ - void setDirection(List directions); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state - * - * @return Returns the List of StateOfEvents for the property state. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state") - List getState(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state - * - * @param states desired value for the property state. - */ - void setState(List states); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker - * - * @return Returns the List of References for the property messageBroker. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker") - List getMessageBroker(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker - * - * @param messageBrokers desired value for the property messageBroker. - */ - void setMessageBroker(List messageBrokers); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic - * - * @return Returns the List of Strings for the property messageTopic. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic") - List getMessageTopic(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic - * - * @param messageTopics desired value for the property messageTopic. - */ - void setMessageTopic(List messageTopics); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate - * - * @return Returns the List of Strings for the property lastUpdate. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate") - List getLastUpdate(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate - * - * @param lastUpdates desired value for the property lastUpdate. - */ - void setLastUpdate(List lastUpdates); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval - * - * @return Returns the List of Strings for the property minInterval. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval") - List getMinInterval(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval - * - * @param minIntervals desired value for the property minInterval. - */ - void setMinInterval(List minIntervals); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval - * - * @return Returns the List of Strings for the property maxInterval. - */ - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval") - List getMaxInterval(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval - * - * @param maxIntervals desired value for the property maxInterval. - */ - void setMaxInterval(List maxIntervals); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java deleted file mode 100644 index 25c0819ae..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BlobMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBlobMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultBlobMetadata.class) -}) -public interface BlobMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java deleted file mode 100644 index 5a3eec1ea..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CapabilityMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultCapabilityMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultCapabilityMetadata.class) -}) -public interface CapabilityMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java deleted file mode 100644 index 0d88c8470..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/EntityMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEntityMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultEntityMetadata.class) -}) -public interface EntityMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java index 02e709ae3..5887c38e5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasDataSpecification.java @@ -26,9 +26,6 @@ */ @KnownSubtypes({ @KnownSubtypes.Type(value = AdministrativeInformation.class), - @KnownSubtypes.Type(value = AssetAdministrationShellMetadata.class), - @KnownSubtypes.Type(value = SubmodelElementAttributes.class), - @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = SubmodelElement.class), diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 36c9c4e39..a7f73523c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -27,8 +27,6 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = SpecificAssetId.class), @KnownSubtypes.Type(value = Extension.class), - @KnownSubtypes.Type(value = SubmodelElementAttributes.class), - @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), @KnownSubtypes.Type(value = Qualifier.class) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java index fa4fe9b00..f878c8cbb 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Identifiable.java @@ -24,8 +24,6 @@ * An element that has a globally unique identifier. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = AssetAdministrationShellMetadata.class), - @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = AssetAdministrationShell.class), @KnownSubtypes.Type(value = ConceptDescription.class), @KnownSubtypes.Type(value = Submodel.class) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java index 3bd08348c..6d0a29988 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java @@ -45,14 +45,31 @@ public interface Message { */ void setCode(String code); + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/correlationId + * + * @return Returns the String for the property correlationId. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/correlationId") + String getCorrelationId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/correlationId + * + * @param correlationId desired value for the property correlationId. + */ + void setCorrelationId(String correlationId); + /** * * More information under https://admin-shell.io/aas/3/0/Message/messageType * - * @return Returns the MessageType for the property messageType. + * @return Returns the MessageTypeEnum for the property messageType. */ @IRI("https://admin-shell.io/aas/3/0/Message/messageType") - MessageType getMessageType(); + MessageTypeEnum getMessageType(); /** * @@ -60,7 +77,7 @@ public interface Message { * * @param messageType desired value for the property messageType. */ - void setMessageType(MessageType messageType); + void setMessageType(MessageTypeEnum messageType); /** * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java similarity index 89% rename from model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java rename to model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java index 45f3a27ba..6542c8111 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageType.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java @@ -21,8 +21,8 @@ /** */ -@IRI("aas:MessageType") -public enum MessageType { +@IRI("aas:MessageTypeEnum") +public enum MessageTypeEnum { /** */ @@ -39,11 +39,6 @@ public enum MessageType { @IRI("https://admin-shell.io/aas/3/0/MessageType/Info") INFO, - /** - */ - @IRI("https://admin-shell.io/aas/3/0/MessageType/Undefined") - UNDEFINED, - /** */ @IRI("https://admin-shell.io/aas/3/0/MessageType/Warning") diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java deleted file mode 100644 index 7fbc6f5a6..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MultiLanguagePropertyMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMultiLanguagePropertyMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultMultiLanguagePropertyMetadata.class) -}) -public interface MultiLanguagePropertyMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java index 6e4b2791e..60987eed4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java @@ -45,21 +45,4 @@ public interface OperationHandle { */ void setHandleId(String handleId); - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationHandle/requestId - * - * @return Returns the String for the property requestId. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationHandle/requestId") - String getRequestId(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationHandle/requestId - * - * @param requestId desired value for the property requestId. - */ - void setRequestId(String requestId); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java deleted file mode 100644 index ac9c0f33d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultOperationMetadata.class) -}) -public interface OperationMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java index 9d1a81e93..c9a1e6404 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java @@ -19,7 +19,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; -import java.math.BigInteger; +import javax.xml.datatype.Duration; +import java.util.List; /** @@ -33,10 +34,10 @@ public interface OperationRequest { * * More information under https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments * - * @return Returns the OperationVariable for the property inoutputArguments. + * @return Returns the List of OperationVariables for the property inoutputArguments. */ @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") - OperationVariable getInoutputArguments(); + List getInoutputArguments(); /** * @@ -44,16 +45,16 @@ public interface OperationRequest { * * @param inoutputArguments desired value for the property inoutputArguments. */ - void setInoutputArguments(OperationVariable inoutputArguments); + void setInoutputArguments(List inoutputArguments); /** * * More information under https://admin-shell.io/aas/3/0/OperationRequest/inputArguments * - * @return Returns the OperationVariable for the property inputArguments. + * @return Returns the List of OperationVariables for the property inputArguments. */ @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") - OperationVariable getInputArguments(); + List getInputArguments(); /** * @@ -61,40 +62,23 @@ public interface OperationRequest { * * @param inputArguments desired value for the property inputArguments. */ - void setInputArguments(OperationVariable inputArguments); + void setInputArguments(List inputArguments); /** * - * More information under https://admin-shell.io/aas/3/0/OperationRequest/requestId + * More information under https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration * - * @return Returns the String for the property requestId. + * @return Returns the String for the property clientTimeoutDuration. */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequest/requestId") - String getRequestId(); + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration") + Duration getClientTimeoutDuration(); /** * - * More information under https://admin-shell.io/aas/3/0/OperationRequest/requestId + * More information under https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration * - * @param requestId desired value for the property requestId. + * @param clientTimeoutDuration desired value for the property clientTimeoutDuration. */ - void setRequestId(String requestId); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequest/timeout - * - * @return Returns the BigInteger for the property timeout. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationRequest/timeout") - BigInteger getTimeout(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationRequest/timeout - * - * @param timeout desired value for the property timeout. - */ - void setTimeout(BigInteger timeout); + void setClientTimeoutDuration(Duration clientTimeoutDuration); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java index b084c5b2f..7ba79ee45 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java @@ -15,11 +15,12 @@ package org.eclipse.digitaltwin.aas4j.v3.model; - import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationResult; +import java.util.List; + /** */ @@ -28,48 +29,14 @@ }) public interface OperationResult { - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/executionResult - * - * @return Returns the Result for the property executionResult. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionResult") - Result getExecutionResult(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/executionResult - * - * @param executionResult desired value for the property executionResult. - */ - void setExecutionResult(Result executionResult); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/executionState - * - * @return Returns the ExecutionState for the property executionState. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionState") - ExecutionState getExecutionState(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/executionState - * - * @param executionState desired value for the property executionState. - */ - void setExecutionState(ExecutionState executionState); - /** * * More information under https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments * - * @return Returns the OperationVariable for the property inoutputArguments. + * @return Returns the List of OperationVariables for the property inoutputArguments. */ @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") - OperationVariable getInoutputArguments(); + List getInoutputArguments(); /** * @@ -77,16 +44,16 @@ public interface OperationResult { * * @param inoutputArguments desired value for the property inoutputArguments. */ - void setInoutputArguments(OperationVariable inoutputArguments); + void setInoutputArguments(List inoutputArguments); /** * * More information under https://admin-shell.io/aas/3/0/OperationResult/outputArguments * - * @return Returns the OperationVariable for the property outputArguments. + * @return Returns the List of OperationVariables for the property outputArguments. */ @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") - OperationVariable getOutputArguments(); + List getOutputArguments(); /** * @@ -94,23 +61,6 @@ public interface OperationResult { * * @param outputArguments desired value for the property outputArguments. */ - void setOutputArguments(OperationVariable outputArguments); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/requestId - * - * @return Returns the String for the property requestId. - */ - @IRI("https://admin-shell.io/aas/3/0/OperationResult/requestId") - String getRequestId(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/OperationResult/requestId - * - * @param requestId desired value for the property requestId. - */ - void setRequestId(String requestId); + void setOutputArguments(List outputArguments); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java deleted file mode 100644 index d8cb2cf44..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PropertyMetadata.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultPropertyMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultPropertyMetadata.class) -}) -public interface PropertyMetadata extends SubmodelElementAttributes { - - /** - * - * More information under https://admin-shell.io/aas/3/0/PropertyMetadata/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/PropertyMetadata/valueType") - DataTypeDefXsd getValueType(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/PropertyMetadata/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java index d64d0d1ae..d8f0e2e84 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Qualifiable.java @@ -25,8 +25,6 @@ * The value of a qualifiable element may be further qualified by one or more qualifiers. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElementAttributes.class), - @KnownSubtypes.Type(value = SubmodelMetadata.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java deleted file mode 100644 index ae5fee31a..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/RangeMetadata.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultRangeMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultRangeMetadata.class) -}) -public interface RangeMetadata extends SubmodelElementAttributes { - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeMetadata/valueType - * - * @return Returns the DataTypeDefXsd for the property valueType. - */ - @IRI("https://admin-shell.io/aas/3/0/RangeMetadata/valueType") - DataTypeDefXsd getValueType(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/RangeMetadata/valueType - * - * @param valueType desired value for the property valueType. - */ - void setValueType(DataTypeDefXsd valueType); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 4f2dc3d08..e899e7a0b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -25,7 +25,6 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElementAttributes.class), @KnownSubtypes.Type(value = Identifiable.class), @KnownSubtypes.Type(value = SubmodelElement.class) }) diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java deleted file mode 100644 index b2443ff45..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ReferenceElementMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReferenceElementMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultReferenceElementMetadata.class) -}) -public interface ReferenceElementMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java index 735dc6605..ff1f97932 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java @@ -25,7 +25,8 @@ /** */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultResult.class) + @KnownSubtypes.Type(value = DefaultResult.class), + @KnownSubtypes.Type(value = BaseOperationResult.class) }) public interface Result { @@ -46,21 +47,4 @@ public interface Result { */ void setMessages(List messages); - /** - * - * More information under https://admin-shell.io/aas/3/0/Result/success - * - * @return Returns the boolean for the property success. - */ - @IRI("https://admin-shell.io/aas/3/0/Result/success") - boolean getSuccess(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/Result/success - * - * @param success desired value for the property success. - */ - void setSuccess(boolean success); - } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java deleted file mode 100644 index 354d5aa53..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementAttributes.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementAttributes; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSubmodelElementAttributes.class), - @KnownSubtypes.Type(value = AnnotatedRelationshipElementMetadata.class), - @KnownSubtypes.Type(value = BasicEventElementMetadata.class), - @KnownSubtypes.Type(value = BlobMetadata.class), - @KnownSubtypes.Type(value = CapabilityMetadata.class), - @KnownSubtypes.Type(value = EntityMetadata.class), - @KnownSubtypes.Type(value = MultiLanguagePropertyMetadata.class), - @KnownSubtypes.Type(value = OperationMetadata.class), - @KnownSubtypes.Type(value = PropertyMetadata.class), - @KnownSubtypes.Type(value = RangeMetadata.class), - @KnownSubtypes.Type(value = ReferenceElementMetadata.class), - @KnownSubtypes.Type(value = SubmodelElementListMetadata.class), - @KnownSubtypes.Type(value = SubmodelElementCollectionMetadata.class) -}) -public interface SubmodelElementAttributes extends HasDataSpecification, Referable, HasSemantics, Qualifiable { - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind - * - * @return Returns the ModellingKind for the property kind. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - ModellingKind getKind(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind - * - * @param kind desired value for the property kind. - */ - void setKind(ModellingKind kind); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java deleted file mode 100644 index b8af15f91..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementCollectionMetadata.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollectionMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSubmodelElementCollectionMetadata.class) -}) -public interface SubmodelElementCollectionMetadata extends SubmodelElementAttributes { - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java deleted file mode 100644 index 94dfca022..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElementListMetadata.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementListMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSubmodelElementListMetadata.class) -}) -public interface SubmodelElementListMetadata extends SubmodelElementAttributes { - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant - * - * @return Returns the boolean for the property orderRelevant. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant") - boolean getOrderRelevant(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant - * - * @param orderRelevant desired value for the property orderRelevant. - */ - void setOrderRelevant(boolean orderRelevant); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement - * - * @return Returns the Reference for the property semanticIdListElement. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement") - Reference getSemanticIdListElement(); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement - * - * @param semanticIdListElement desired value for the property semanticIdListElement. - */ - void setSemanticIdListElement(Reference semanticIdListElement); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement - * - * @return Returns the ModelType for the property typeValueListElement. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement") - ModelType getTypeValueListElement(); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement - * - * @param typeValueListElement desired value for the property typeValueListElement. - */ - void setTypeValueListElement(ModelType typeValueListElement); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement - * - * @return Returns the DataTypeDefXsd for the property valueTypeListElement. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); - - /** - * - * More information under - * https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement - * - * @param valueTypeListElement desired value for the property valueTypeListElement. - */ - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java deleted file mode 100644 index 694cd464d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelMetadata.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelMetadata; - - -/** -*/ -@KnownSubtypes({ - @KnownSubtypes.Type(value = DefaultSubmodelMetadata.class) -}) -public interface SubmodelMetadata extends Identifiable, HasDataSpecification, HasSemantics, Qualifiable { - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelMetadata/kind - * - * @return Returns the ModellingKind for the property kind. - */ - @IRI("https://admin-shell.io/aas/3/0/SubmodelMetadata/kind") - ModellingKind getKind(); - - /** - * - * More information under https://admin-shell.io/aas/3/0/SubmodelMetadata/kind - * - * @param kind desired value for the property kind. - */ - void setKind(ModellingKind kind); - -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java deleted file mode 100644 index 6e1966fa6..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class AnnotatedRelationshipElementMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java deleted file mode 100644 index 8b3b7387a..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellMetadataBuilder.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class AssetAdministrationShellMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for derivedFrom - * - * @param derivedFroms desired value to be set - * @return Builder object with new value for derivedFrom - */ - public B derivedFrom(List derivedFroms) { - getBuildingInstance().setDerivedFrom(derivedFroms); - return getSelf(); - } - - /** - * This function allows adding a value to the List derivedFrom - * - * @param derivedFrom desired value to be added - * @return Builder object with new value for derivedFrom - */ - public B derivedFrom(Reference derivedFrom) { - getBuildingInstance().getDerivedFrom().add(derivedFrom); - return getSelf(); - } - - /** - * This function allows setting a value for administration - * - * @param administration desired value to be set - * @return Builder object with new value for administration - */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); - return getSelf(); - } - - /** - * This function allows setting a value for id - * - * @param id desired value to be set - * @return Builder object with new value for id - */ - public B id(String id) { - getBuildingInstance().setId(id); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java new file mode 100644 index 000000000..eea07026f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; +import org.eclipse.digitaltwin.aas4j.v3.model.Message; + +import java.util.List; + + +public abstract class BaseOperationResultBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for executionState + * + * @param executionState desired value to be set + * @return Builder object with new value for executionState + */ + public B executionState(ExecutionState executionState) { + getBuildingInstance().setExecutionState(executionState); + return getSelf(); + } + + /** + * This function allows setting a value for success + * + * @param success desired value to be set + * @return Builder object with new value for success + */ + public B success(boolean success) { + getBuildingInstance().setSuccess(success); + return getSelf(); + } + + /** + * This function allows setting a value for messages + * + * @param messages desired value to be set + * @return Builder object with new value for messages + */ + public B messages(List messages) { + getBuildingInstance().setMessages(messages); + return getSelf(); + } + + /** + * This function allows adding a value to the List messages + * + * @param messages desired value to be added + * @return Builder object with new value for messages + */ + public B messages(Message messages) { + getBuildingInstance().getMessages().add(messages); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java deleted file mode 100644 index eecf3e465..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementMetadataBuilder.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; - -import java.util.List; - - -public abstract class BasicEventElementMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for direction - * - * @param directions desired value to be set - * @return Builder object with new value for direction - */ - public B direction(List directions) { - getBuildingInstance().setDirection(directions); - return getSelf(); - } - - /** - * This function allows adding a value to the List direction - * - * @param direction desired value to be added - * @return Builder object with new value for direction - */ - public B direction(Direction direction) { - getBuildingInstance().getDirection().add(direction); - return getSelf(); - } - - /** - * This function allows setting a value for state - * - * @param states desired value to be set - * @return Builder object with new value for state - */ - public B state(List states) { - getBuildingInstance().setState(states); - return getSelf(); - } - - /** - * This function allows adding a value to the List state - * - * @param state desired value to be added - * @return Builder object with new value for state - */ - public B state(StateOfEvent state) { - getBuildingInstance().getState().add(state); - return getSelf(); - } - - /** - * This function allows setting a value for messageBroker - * - * @param messageBrokers desired value to be set - * @return Builder object with new value for messageBroker - */ - public B messageBroker(List messageBrokers) { - getBuildingInstance().setMessageBroker(messageBrokers); - return getSelf(); - } - - /** - * This function allows adding a value to the List messageBroker - * - * @param messageBroker desired value to be added - * @return Builder object with new value for messageBroker - */ - public B messageBroker(Reference messageBroker) { - getBuildingInstance().getMessageBroker().add(messageBroker); - return getSelf(); - } - - /** - * This function allows setting a value for messageTopic - * - * @param messageTopics desired value to be set - * @return Builder object with new value for messageTopic - */ - public B messageTopic(List messageTopics) { - getBuildingInstance().setMessageTopic(messageTopics); - return getSelf(); - } - - /** - * This function allows adding a value to the List messageTopic - * - * @param messageTopic desired value to be added - * @return Builder object with new value for messageTopic - */ - public B messageTopic(String messageTopic) { - getBuildingInstance().getMessageTopic().add(messageTopic); - return getSelf(); - } - - /** - * This function allows setting a value for lastUpdate - * - * @param lastUpdates desired value to be set - * @return Builder object with new value for lastUpdate - */ - public B lastUpdate(List lastUpdates) { - getBuildingInstance().setLastUpdate(lastUpdates); - return getSelf(); - } - - /** - * This function allows adding a value to the List lastUpdate - * - * @param lastUpdate desired value to be added - * @return Builder object with new value for lastUpdate - */ - public B lastUpdate(String lastUpdate) { - getBuildingInstance().getLastUpdate().add(lastUpdate); - return getSelf(); - } - - /** - * This function allows setting a value for minInterval - * - * @param minIntervals desired value to be set - * @return Builder object with new value for minInterval - */ - public B minInterval(List minIntervals) { - getBuildingInstance().setMinInterval(minIntervals); - return getSelf(); - } - - /** - * This function allows adding a value to the List minInterval - * - * @param minInterval desired value to be added - * @return Builder object with new value for minInterval - */ - public B minInterval(String minInterval) { - getBuildingInstance().getMinInterval().add(minInterval); - return getSelf(); - } - - /** - * This function allows setting a value for maxInterval - * - * @param maxIntervals desired value to be set - * @return Builder object with new value for maxInterval - */ - public B maxInterval(List maxIntervals) { - getBuildingInstance().setMaxInterval(maxIntervals); - return getSelf(); - } - - /** - * This function allows adding a value to the List maxInterval - * - * @param maxInterval desired value to be added - * @return Builder object with new value for maxInterval - */ - public B maxInterval(String maxInterval) { - getBuildingInstance().getMaxInterval().add(maxInterval); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java deleted file mode 100644 index 3f93479c0..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobMetadataBuilder.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.BlobMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class BlobMetadataBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java deleted file mode 100644 index 131286c4b..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.CapabilityMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class CapabilityMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java deleted file mode 100644 index 8a533c593..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class EntityMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java index f3e92b179..2450de674 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java @@ -17,7 +17,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Message; -import org.eclipse.digitaltwin.aas4j.v3.model.MessageType; +import org.eclipse.digitaltwin.aas4j.v3.model.MessageTypeEnum; public abstract class MessageBuilder> extends ExtendableBuilder { @@ -33,13 +33,24 @@ public B code(String code) { return getSelf(); } + /** + * This function allows setting a value for correlationId + * + * @param correlationId desired value to be set + * @return Builder object with new value for correlationId + */ + public B correlationId(String correlationId) { + getBuildingInstance().setCorrelationId(correlationId); + return getSelf(); + } + /** * This function allows setting a value for messageType * * @param messageType desired value to be set * @return Builder object with new value for messageType */ - public B messageType(MessageType messageType) { + public B messageType(MessageTypeEnum messageType) { getBuildingInstance().setMessageType(messageType); return getSelf(); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java deleted file mode 100644 index c564cf268..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class MultiLanguagePropertyMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index 3bdee33de..c8270827f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -95,28 +95,6 @@ public B inoutputVariables(OperationVariable inoutputVariables) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -205,6 +183,28 @@ public B extensions(Extension extensions) { return getSelf(); } + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + /** * This function allows setting a value for semanticId * diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java index df4a935ae..1307ed2b5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java @@ -32,15 +32,4 @@ public B handleId(String handleId) { getBuildingInstance().setHandleId(handleId); return getSelf(); } - - /** - * This function allows setting a value for requestId - * - * @param requestId desired value to be set - * @return Builder object with new value for requestId - */ - public B requestId(String requestId) { - getBuildingInstance().setRequestId(requestId); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java deleted file mode 100644 index 1a0620da4..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class OperationMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java index 395013ddd..fe598803f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java @@ -18,7 +18,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import java.math.BigInteger; +import javax.xml.datatype.Duration; +import java.util.List; public abstract class OperationRequestBuilder> @@ -30,41 +31,52 @@ public abstract class OperationRequestBuilder inoutputArguments) { getBuildingInstance().setInoutputArguments(inoutputArguments); return getSelf(); } + /** + * This function allows adding a value to the List inoutputArguments + * + * @param inoutputArguments desired value to be added + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(OperationVariable inoutputArguments) { + getBuildingInstance().getInoutputArguments().add(inoutputArguments); + return getSelf(); + } + /** * This function allows setting a value for inputArguments * * @param inputArguments desired value to be set * @return Builder object with new value for inputArguments */ - public B inputArguments(OperationVariable inputArguments) { + public B inputArguments(List inputArguments) { getBuildingInstance().setInputArguments(inputArguments); return getSelf(); } /** - * This function allows setting a value for requestId + * This function allows adding a value to the List inputArguments * - * @param requestId desired value to be set - * @return Builder object with new value for requestId + * @param inputArguments desired value to be added + * @return Builder object with new value for inputArguments */ - public B requestId(String requestId) { - getBuildingInstance().setRequestId(requestId); + public B inputArguments(OperationVariable inputArguments) { + getBuildingInstance().getInputArguments().add(inputArguments); return getSelf(); } /** - * This function allows setting a value for timeout + * This function allows setting a value for clientTimeoutDuration * - * @param timeout desired value to be set - * @return Builder object with new value for timeout + * @param clientTimeoutDuration desired value to be set + * @return Builder object with new value for clientTimeoutDuration */ - public B timeout(BigInteger timeout) { - getBuildingInstance().setTimeout(timeout); + public B clientTimeoutDuration(Duration clientTimeoutDuration) { + getBuildingInstance().setClientTimeoutDuration(clientTimeoutDuration); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java index c422b0536..edf5b944f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java @@ -15,46 +15,34 @@ package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; import org.eclipse.digitaltwin.aas4j.v3.model.OperationResult; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Result; + +import java.util.List; public abstract class OperationResultBuilder> extends ExtendableBuilder { /** - * This function allows setting a value for executionResult - * - * @param executionResult desired value to be set - * @return Builder object with new value for executionResult - */ - public B executionResult(Result executionResult) { - getBuildingInstance().setExecutionResult(executionResult); - return getSelf(); - } - - /** - * This function allows setting a value for executionState + * This function allows setting a value for inoutputArguments * - * @param executionState desired value to be set - * @return Builder object with new value for executionState + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments */ - public B executionState(ExecutionState executionState) { - getBuildingInstance().setExecutionState(executionState); + public B inoutputArguments(List inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); return getSelf(); } /** - * This function allows setting a value for inoutputArguments + * This function allows adding a value to the List inoutputArguments * - * @param inoutputArguments desired value to be set + * @param inoutputArguments desired value to be added * @return Builder object with new value for inoutputArguments */ public B inoutputArguments(OperationVariable inoutputArguments) { - getBuildingInstance().setInoutputArguments(inoutputArguments); + getBuildingInstance().getInoutputArguments().add(inoutputArguments); return getSelf(); } @@ -64,19 +52,19 @@ public B inoutputArguments(OperationVariable inoutputArguments) { * @param outputArguments desired value to be set * @return Builder object with new value for outputArguments */ - public B outputArguments(OperationVariable outputArguments) { + public B outputArguments(List outputArguments) { getBuildingInstance().setOutputArguments(outputArguments); return getSelf(); } /** - * This function allows setting a value for requestId + * This function allows adding a value to the List outputArguments * - * @param requestId desired value to be set - * @return Builder object with new value for requestId + * @param outputArguments desired value to be added + * @return Builder object with new value for outputArguments */ - public B requestId(String requestId) { - getBuildingInstance().setRequestId(requestId); + public B outputArguments(OperationVariable outputArguments) { + getBuildingInstance().getOutputArguments().add(outputArguments); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java deleted file mode 100644 index 155771e46..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyMetadataBuilder.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.PropertyMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class PropertyMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java deleted file mode 100644 index c75d55507..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeMetadataBuilder.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.RangeMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - - -public abstract class RangeMetadataBuilder> extends ExtendableBuilder { - - /** - * This function allows setting a value for valueType - * - * @param valueType desired value to be set - * @return Builder object with new value for valueType - */ - public B valueType(DataTypeDefXsd valueType) { - getBuildingInstance().setValueType(valueType); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java deleted file mode 100644 index 6da812098..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementMetadata; - -import java.util.List; - - -public abstract class ReferenceElementMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java index a2936d370..db842fc77 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java @@ -44,15 +44,4 @@ public B messages(Message messages) { getBuildingInstance().getMessages().add(messages); return getSelf(); } - - /** - * This function allows setting a value for success - * - * @param success desired value to be set - * @return Builder object with new value for success - */ - public B success(boolean success) { - getBuildingInstance().setSuccess(success); - return getSelf(); - } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java deleted file mode 100644 index 18eedb835..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementAttributesBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementAttributes; - -import java.util.List; - - -public abstract class SubmodelElementAttributesBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java deleted file mode 100644 index 40f489577..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionMetadataBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollectionMetadata; - -import java.util.List; - - -public abstract class SubmodelElementCollectionMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java deleted file mode 100644 index eac252f72..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListMetadataBuilder.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListMetadata; - -import java.util.List; - - -public abstract class SubmodelElementListMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for orderRelevant - * - * @param orderRelevant desired value to be set - * @return Builder object with new value for orderRelevant - */ - public B orderRelevant(boolean orderRelevant) { - getBuildingInstance().setOrderRelevant(orderRelevant); - return getSelf(); - } - - /** - * This function allows setting a value for semanticIdListElement - * - * @param semanticIdListElement desired value to be set - * @return Builder object with new value for semanticIdListElement - */ - public B semanticIdListElement(Reference semanticIdListElement) { - getBuildingInstance().setSemanticIdListElement(semanticIdListElement); - return getSelf(); - } - - /** - * This function allows setting a value for typeValueListElement - * - * @param typeValueListElement desired value to be set - * @return Builder object with new value for typeValueListElement - */ - public B typeValueListElement(ModelType typeValueListElement) { - getBuildingInstance().setTypeValueListElement(typeValueListElement); - return getSelf(); - } - - /** - * This function allows setting a value for valueTypeListElement - * - * @param valueTypeListElement desired value to be set - * @return Builder object with new value for valueTypeListElement - */ - public B valueTypeListElement(DataTypeDefXsd valueTypeListElement) { - getBuildingInstance().setValueTypeListElement(valueTypeListElement); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java deleted file mode 100644 index d1918aaa8..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelMetadataBuilder.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.builder; - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelMetadata; - -import java.util.List; - - -public abstract class SubmodelMetadataBuilder> - extends ExtendableBuilder { - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for administration - * - * @param administration desired value to be set - * @return Builder object with new value for administration - */ - public B administration(AdministrativeInformation administration) { - getBuildingInstance().setAdministration(administration); - return getSelf(); - } - - /** - * This function allows setting a value for id - * - * @param id desired value to be set - * @return Builder object with new value for id - */ - public B id(String id) { - getBuildingInstance().setId(id); - return getSelf(); - } - - /** - * This function allows setting a value for category - * - * @param category desired value to be set - * @return Builder object with new value for category - */ - public B category(String category) { - getBuildingInstance().setCategory(category); - return getSelf(); - } - - /** - * This function allows setting a value for idShort - * - * @param idShort desired value to be set - * @return Builder object with new value for idShort - */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); - return getSelf(); - } - - /** - * This function allows setting a value for displayName - * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName - */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); - return getSelf(); - } - - /** - * This function allows adding a value to the List displayName - * - * @param displayName desired value to be added - * @return Builder object with new value for displayName - */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); - return getSelf(); - } - - /** - * This function allows setting a value for description - * - * @param descriptions desired value to be set - * @return Builder object with new value for description - */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); - return getSelf(); - } - - /** - * This function allows adding a value to the List description - * - * @param description desired value to be added - * @return Builder object with new value for description - */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); - return getSelf(); - } - - /** - * This function allows setting a value for extensions - * - * @param extensions desired value to be set - * @return Builder object with new value for extensions - */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); - return getSelf(); - } - - /** - * This function allows adding a value to the List extensions - * - * @param extensions desired value to be added - * @return Builder object with new value for extensions - */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); - return getSelf(); - } - - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java deleted file mode 100644 index 2a8257ff7..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElementMetadata.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AnnotatedRelationshipElementMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElementMetadata - * - */ - -@IRI("aas:AnnotatedRelationshipElementMetadata") -public class DefaultAnnotatedRelationshipElementMetadata implements AnnotatedRelationshipElementMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultAnnotatedRelationshipElementMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultAnnotatedRelationshipElementMetadata other = (DefaultAnnotatedRelationshipElementMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultAnnotatedRelationshipElementMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultAnnotatedRelationshipElementMetadata bean. - */ - public static class Builder extends AnnotatedRelationshipElementMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultAnnotatedRelationshipElementMetadata newBuildingInstance() { - return new DefaultAnnotatedRelationshipElementMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java deleted file mode 100644 index ad16e5d11..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellMetadata.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellMetadata - * - */ - -@IRI("aas:AssetAdministrationShellMetadata") -public class DefaultAssetAdministrationShellMetadata implements AssetAdministrationShellMetadata { - - @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellMetadata/derivedFrom") - protected List derivedFrom = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") - protected AdministrativeInformation administration; - - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") - protected String id; - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - public DefaultAssetAdministrationShellMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.derivedFrom, - this.administration, - this.id, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.embeddedDataSpecifications); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultAssetAdministrationShellMetadata other = (DefaultAssetAdministrationShellMetadata) obj; - return Objects.equals(this.derivedFrom, other.derivedFrom) && - Objects.equals(this.administration, other.administration) && - Objects.equals(this.id, other.id) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); - } - } - - @Override - public List getDerivedFrom() { - return derivedFrom; - } - - @Override - public void setDerivedFrom(List derivedFroms) { - this.derivedFrom = derivedFroms; - } - - @Override - public AdministrativeInformation getAdministration() { - return administration; - } - - @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; - } - - @Override - public String getId() { - return id; - } - - @Override - public void setId(String id) { - this.id = id; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - public String toString() { - return String.format( - "DefaultAssetAdministrationShellMetadata (" + "derivedFrom=%s," - + ")", - this.derivedFrom); - } - - /** - * This builder class can be used to construct a DefaultAssetAdministrationShellMetadata bean. - */ - public static class Builder extends AssetAdministrationShellMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultAssetAdministrationShellMetadata newBuildingInstance() { - return new DefaultAssetAdministrationShellMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java new file mode 100644 index 000000000..e9507263c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package org.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.BaseOperationResultBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult + * + */ + +@IRI("aas:BaseOperationResult") +public class DefaultBaseOperationResult implements BaseOperationResult { + + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/executionState") + protected ExecutionState executionState; + + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/success") + protected boolean success; + + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + protected List messages = new ArrayList<>(); + + public DefaultBaseOperationResult() {} + + @Override + public int hashCode() { + return Objects.hash(this.executionState, + this.success, + this.messages); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBaseOperationResult other = (DefaultBaseOperationResult) obj; + return Objects.equals(this.executionState, other.executionState) && + Objects.equals(this.success, other.success) && + Objects.equals(this.messages, other.messages); + } + } + + @Override + public ExecutionState getExecutionState() { + return executionState; + } + + @Override + public void setExecutionState(ExecutionState executionState) { + this.executionState = executionState; + } + + @Override + public boolean getSuccess() { + return success; + } + + @Override + public void setSuccess(boolean success) { + this.success = success; + } + + @Override + public List getMessages() { + return messages; + } + + @Override + public void setMessages(List messages) { + this.messages = messages; + } + + public String toString() { + return String.format( + "DefaultBaseOperationResult (" + "executionState=%s," + + "success=%s," + + ")", + this.executionState, this.success); + } + + /** + * This builder class can be used to construct a DefaultBaseOperationResult bean. + */ + public static class Builder extends BaseOperationResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBaseOperationResult newBuildingInstance() { + return new DefaultBaseOperationResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java deleted file mode 100644 index e8fd60e9a..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElementMetadata.java +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Direction; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BasicEventElementMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElementMetadata - * - */ - -@IRI("aas:BasicEventElementMetadata") -public class DefaultBasicEventElementMetadata implements BasicEventElementMetadata { - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/direction") - protected List direction = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/lastUpdate") - protected List lastUpdate = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/maxInterval") - protected List maxInterval = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageBroker") - protected List messageBroker = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/messageTopic") - protected List messageTopic = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/minInterval") - protected List minInterval = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/BasicEventElementMetadata/state") - protected List state = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultBasicEventElementMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.direction, - this.state, - this.messageBroker, - this.messageTopic, - this.lastUpdate, - this.minInterval, - this.maxInterval, - this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultBasicEventElementMetadata other = (DefaultBasicEventElementMetadata) obj; - return Objects.equals(this.direction, other.direction) && - Objects.equals(this.state, other.state) && - Objects.equals(this.messageBroker, other.messageBroker) && - Objects.equals(this.messageTopic, other.messageTopic) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.maxInterval, other.maxInterval) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public List getDirection() { - return direction; - } - - @Override - public void setDirection(List directions) { - this.direction = directions; - } - - @Override - public List getState() { - return state; - } - - @Override - public void setState(List states) { - this.state = states; - } - - @Override - public List getMessageBroker() { - return messageBroker; - } - - @Override - public void setMessageBroker(List messageBrokers) { - this.messageBroker = messageBrokers; - } - - @Override - public List getMessageTopic() { - return messageTopic; - } - - @Override - public void setMessageTopic(List messageTopics) { - this.messageTopic = messageTopics; - } - - @Override - public List getLastUpdate() { - return lastUpdate; - } - - @Override - public void setLastUpdate(List lastUpdates) { - this.lastUpdate = lastUpdates; - } - - @Override - public List getMinInterval() { - return minInterval; - } - - @Override - public void setMinInterval(List minIntervals) { - this.minInterval = minIntervals; - } - - @Override - public List getMaxInterval() { - return maxInterval; - } - - @Override - public void setMaxInterval(List maxIntervals) { - this.maxInterval = maxIntervals; - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultBasicEventElementMetadata (" + "direction=%s," - + "state=%s," - + "messageBroker=%s," - + "messageTopic=%s," - + "lastUpdate=%s," - + "minInterval=%s," - + "maxInterval=%s," - + ")", - this.direction, this.state, this.messageBroker, this.messageTopic, this.lastUpdate, this.minInterval, this.maxInterval); - } - - /** - * This builder class can be used to construct a DefaultBasicEventElementMetadata bean. - */ - public static class Builder extends BasicEventElementMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultBasicEventElementMetadata newBuildingInstance() { - return new DefaultBasicEventElementMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index 76bc9271f..c0208e296 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -230,7 +230,7 @@ public String toString() { "DefaultBlob (" + "value=%s," + "contentType=%s," + ")", - this.value, this.contentType); + Arrays.toString(this.value), this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java deleted file mode 100644 index 3d230a05b..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlobMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.BlobMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.BlobMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BlobMetadata - * - */ - -@IRI("aas:BlobMetadata") -public class DefaultBlobMetadata implements BlobMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultBlobMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultBlobMetadata other = (DefaultBlobMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultBlobMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultBlobMetadata bean. - */ - public static class Builder extends BlobMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultBlobMetadata newBuildingInstance() { - return new DefaultBlobMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java deleted file mode 100644 index 40405b8bb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapabilityMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.CapabilityMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.CapabilityMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.CapabilityMetadata - * - */ - -@IRI("aas:CapabilityMetadata") -public class DefaultCapabilityMetadata implements CapabilityMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultCapabilityMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultCapabilityMetadata other = (DefaultCapabilityMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultCapabilityMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultCapabilityMetadata bean. - */ - public static class Builder extends CapabilityMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultCapabilityMetadata newBuildingInstance() { - return new DefaultCapabilityMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java deleted file mode 100644 index bd8b9c0da..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntityMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.EntityMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.EntityMetadata - * - */ - -@IRI("aas:EntityMetadata") -public class DefaultEntityMetadata implements EntityMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultEntityMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultEntityMetadata other = (DefaultEntityMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultEntityMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultEntityMetadata bean. - */ - public static class Builder extends EntityMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultEntityMetadata newBuildingInstance() { - return new DefaultEntityMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index 750f1c5ff..5e9a29003 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -184,7 +184,7 @@ public String toString() { + "payload=%s," + ")", this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, - this.timeStamp, this.payload); + this.timeStamp, Arrays.toString(this.payload)); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java index f9133494a..89b06f102 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java @@ -16,7 +16,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; import org.eclipse.digitaltwin.aas4j.v3.model.Message; -import org.eclipse.digitaltwin.aas4j.v3.model.MessageType; +import org.eclipse.digitaltwin.aas4j.v3.model.MessageTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.MessageBuilder; @@ -34,8 +34,11 @@ public class DefaultMessage implements Message { @IRI("https://admin-shell.io/aas/3/0/Message/code") protected String code; + @IRI("https://admin-shell.io/aas/3/0/Message/correlationId") + protected String correlationId; + @IRI("https://admin-shell.io/aas/3/0/Message/messageType") - protected MessageType messageType; + protected MessageTypeEnum messageType; @IRI("https://admin-shell.io/aas/3/0/Message/text") protected String text; @@ -48,6 +51,7 @@ public DefaultMessage() {} @Override public int hashCode() { return Objects.hash(this.code, + this.correlationId, this.messageType, this.text, this.timestamp); @@ -64,6 +68,7 @@ public boolean equals(Object obj) { } else { DefaultMessage other = (DefaultMessage) obj; return Objects.equals(this.code, other.code) && + Objects.equals(this.correlationId, other.correlationId) && Objects.equals(this.messageType, other.messageType) && Objects.equals(this.text, other.text) && Objects.equals(this.timestamp, other.timestamp); @@ -81,12 +86,22 @@ public void setCode(String code) { } @Override - public MessageType getMessageType() { + public String getCorrelationId() { + return correlationId; + } + + @Override + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + @Override + public MessageTypeEnum getMessageType() { return messageType; } @Override - public void setMessageType(MessageType messageType) { + public void setMessageType(MessageTypeEnum messageType) { this.messageType = messageType; } @@ -113,11 +128,12 @@ public void setTimestamp(String timestamp) { public String toString() { return String.format( "DefaultMessage (" + "code=%s," + + "correlationId=%s," + "messageType=%s," + "text=%s," + "timestamp=%s," + ")", - this.code, this.messageType, this.text, this.timestamp); + this.code, this.correlationId, this.messageType, this.text, this.timestamp); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java deleted file mode 100644 index 628be14e0..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguagePropertyMetadata.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.MultiLanguagePropertyMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguagePropertyMetadata - * - */ - -@IRI("aas:MultiLanguagePropertyMetadata") -public class DefaultMultiLanguagePropertyMetadata implements MultiLanguagePropertyMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultMultiLanguagePropertyMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultMultiLanguagePropertyMetadata other = (DefaultMultiLanguagePropertyMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultMultiLanguagePropertyMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultMultiLanguagePropertyMetadata bean. - */ - public static class Builder extends MultiLanguagePropertyMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultMultiLanguagePropertyMetadata newBuildingInstance() { - return new DefaultMultiLanguagePropertyMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java index 5d0c2aff4..7a1160c44 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java @@ -33,15 +33,11 @@ public class DefaultOperationHandle implements OperationHandle { @IRI("https://admin-shell.io/aas/3/0/OperationHandle/handleId") protected String handleId; - @IRI("https://admin-shell.io/aas/3/0/OperationHandle/requestId") - protected String requestId; - public DefaultOperationHandle() {} @Override public int hashCode() { - return Objects.hash(this.handleId, - this.requestId); + return Objects.hash(this.handleId); } @Override @@ -54,8 +50,7 @@ public boolean equals(Object obj) { return false; } else { DefaultOperationHandle other = (DefaultOperationHandle) obj; - return Objects.equals(this.handleId, other.handleId) && - Objects.equals(this.requestId, other.requestId); + return Objects.equals(this.handleId, other.handleId); } } @@ -69,22 +64,11 @@ public void setHandleId(String handleId) { this.handleId = handleId; } - @Override - public String getRequestId() { - return requestId; - } - - @Override - public void setRequestId(String requestId) { - this.requestId = requestId; - } - public String toString() { return String.format( "DefaultOperationHandle (" + "handleId=%s," - + "requestId=%s," + ")", - this.handleId, this.requestId); + this.handleId); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java deleted file mode 100644 index fe97e5cea..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationMetadata - * - */ - -@IRI("aas:OperationMetadata") -public class DefaultOperationMetadata implements OperationMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultOperationMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultOperationMetadata other = (DefaultOperationMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultOperationMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultOperationMetadata bean. - */ - public static class Builder extends OperationMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultOperationMetadata newBuildingInstance() { - return new DefaultOperationMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java index 6691303a3..71bda258e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java @@ -20,7 +20,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationRequestBuilder; -import java.math.BigInteger; +import javax.xml.datatype.Duration; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @@ -32,17 +34,14 @@ @IRI("aas:OperationRequest") public class DefaultOperationRequest implements OperationRequest { + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration") + protected Duration clientTimeoutDuration; + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") - protected OperationVariable inoutputArguments; + protected List inoutputArguments = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") - protected OperationVariable inputArguments; - - @IRI("https://admin-shell.io/aas/3/0/OperationRequest/requestId") - protected String requestId; - - @IRI("https://admin-shell.io/aas/3/0/OperationRequest/timeout") - protected BigInteger timeout; + protected List inputArguments = new ArrayList<>(); public DefaultOperationRequest() {} @@ -50,8 +49,7 @@ public DefaultOperationRequest() {} public int hashCode() { return Objects.hash(this.inoutputArguments, this.inputArguments, - this.requestId, - this.timeout); + this.clientTimeoutDuration); } @Override @@ -66,59 +64,47 @@ public boolean equals(Object obj) { DefaultOperationRequest other = (DefaultOperationRequest) obj; return Objects.equals(this.inoutputArguments, other.inoutputArguments) && Objects.equals(this.inputArguments, other.inputArguments) && - Objects.equals(this.requestId, other.requestId) && - Objects.equals(this.timeout, other.timeout); + Objects.equals(this.clientTimeoutDuration, other.clientTimeoutDuration); } } @Override - public OperationVariable getInoutputArguments() { + public List getInoutputArguments() { return inoutputArguments; } @Override - public void setInoutputArguments(OperationVariable inoutputArguments) { + public void setInoutputArguments(List inoutputArguments) { this.inoutputArguments = inoutputArguments; } @Override - public OperationVariable getInputArguments() { + public List getInputArguments() { return inputArguments; } @Override - public void setInputArguments(OperationVariable inputArguments) { + public void setInputArguments(List inputArguments) { this.inputArguments = inputArguments; } @Override - public String getRequestId() { - return requestId; - } - - @Override - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - @Override - public BigInteger getTimeout() { - return timeout; + public Duration getClientTimeoutDuration() { + return clientTimeoutDuration; } @Override - public void setTimeout(BigInteger timeout) { - this.timeout = timeout; + public void setClientTimeoutDuration(Duration clientTimeoutDuration) { + this.clientTimeoutDuration = clientTimeoutDuration; } public String toString() { return String.format( "DefaultOperationRequest (" + "inoutputArguments=%s," + "inputArguments=%s," - + "requestId=%s," - + "timeout=%s," + + "clientTimeoutDuration=%s," + ")", - this.inoutputArguments, this.inputArguments, this.requestId, this.timeout); + this.inoutputArguments, this.inputArguments, this.clientTimeoutDuration); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java index 724e7382e..763676200 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java @@ -15,13 +15,13 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; import org.eclipse.digitaltwin.aas4j.v3.model.OperationResult; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Result; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationResultBuilder; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @@ -33,30 +33,18 @@ @IRI("aas:OperationResult") public class DefaultOperationResult implements OperationResult { - @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionResult") - protected Result executionResult; - - @IRI("https://admin-shell.io/aas/3/0/OperationResult/executionState") - protected ExecutionState executionState; - @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") - protected OperationVariable inoutputArguments; + protected List inoutputArguments = new ArrayList<>(); @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") - protected OperationVariable outputArguments; - - @IRI("https://admin-shell.io/aas/3/0/OperationResult/requestId") - protected String requestId; + protected List outputArguments = new ArrayList<>(); public DefaultOperationResult() {} @Override public int hashCode() { - return Objects.hash(this.executionResult, - this.executionState, - this.inoutputArguments, - this.outputArguments, - this.requestId); + return Objects.hash(this.inoutputArguments, + this.outputArguments); } @Override @@ -69,73 +57,37 @@ public boolean equals(Object obj) { return false; } else { DefaultOperationResult other = (DefaultOperationResult) obj; - return Objects.equals(this.executionResult, other.executionResult) && - Objects.equals(this.executionState, other.executionState) && - Objects.equals(this.inoutputArguments, other.inoutputArguments) && - Objects.equals(this.outputArguments, other.outputArguments) && - Objects.equals(this.requestId, other.requestId); + return Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.outputArguments, other.outputArguments); } } @Override - public Result getExecutionResult() { - return executionResult; - } - - @Override - public void setExecutionResult(Result executionResult) { - this.executionResult = executionResult; - } - - @Override - public ExecutionState getExecutionState() { - return executionState; - } - - @Override - public void setExecutionState(ExecutionState executionState) { - this.executionState = executionState; - } - - @Override - public OperationVariable getInoutputArguments() { + public List getInoutputArguments() { return inoutputArguments; } @Override - public void setInoutputArguments(OperationVariable inoutputArguments) { + public void setInoutputArguments(List inoutputArguments) { this.inoutputArguments = inoutputArguments; } @Override - public OperationVariable getOutputArguments() { + public List getOutputArguments() { return outputArguments; } @Override - public void setOutputArguments(OperationVariable outputArguments) { + public void setOutputArguments(List outputArguments) { this.outputArguments = outputArguments; } - @Override - public String getRequestId() { - return requestId; - } - - @Override - public void setRequestId(String requestId) { - this.requestId = requestId; - } - public String toString() { return String.format( - "DefaultOperationResult (" + "executionResult=%s," - + "executionState=%s," - + "inoutputArguments=%s," + "DefaultOperationResult (" + "inoutputArguments=%s," + "outputArguments=%s," - + "requestId=%s," + ")", - this.executionResult, this.executionState, this.inoutputArguments, this.outputArguments, this.requestId); + this.inoutputArguments, this.outputArguments); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java deleted file mode 100644 index a125a58ea..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPropertyMetadata.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.PropertyMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.PropertyMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.PropertyMetadata - * - */ - -@IRI("aas:PropertyMetadata") -public class DefaultPropertyMetadata implements PropertyMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/PropertyMetadata/valueType") - protected DataTypeDefXsd valueType; - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultPropertyMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.valueType, - this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultPropertyMetadata other = (DefaultPropertyMetadata) obj; - return Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultPropertyMetadata (" + "valueType=%s," - + ")", - this.valueType); - } - - /** - * This builder class can be used to construct a DefaultPropertyMetadata bean. - */ - public static class Builder extends PropertyMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultPropertyMetadata newBuildingInstance() { - return new DefaultPropertyMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java deleted file mode 100644 index e0539225d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRangeMetadata.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.RangeMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.RangeMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.RangeMetadata - * - */ - -@IRI("aas:RangeMetadata") -public class DefaultRangeMetadata implements RangeMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/RangeMetadata/valueType") - protected DataTypeDefXsd valueType; - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultRangeMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.valueType, - this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultRangeMetadata other = (DefaultRangeMetadata) obj; - return Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public DataTypeDefXsd getValueType() { - return valueType; - } - - @Override - public void setValueType(DataTypeDefXsd valueType) { - this.valueType = valueType; - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultRangeMetadata (" + "valueType=%s," - + ")", - this.valueType); - } - - /** - * This builder class can be used to construct a DefaultRangeMetadata bean. - */ - public static class Builder extends RangeMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultRangeMetadata newBuildingInstance() { - return new DefaultRangeMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java deleted file mode 100644 index 690d6a6c3..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElementMetadata.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.ReferenceElementMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElementMetadata - * - */ - -@IRI("aas:ReferenceElementMetadata") -public class DefaultReferenceElementMetadata implements ReferenceElementMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultReferenceElementMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultReferenceElementMetadata other = (DefaultReferenceElementMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultReferenceElementMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultReferenceElementMetadata bean. - */ - public static class Builder extends ReferenceElementMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultReferenceElementMetadata newBuildingInstance() { - return new DefaultReferenceElementMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java index 2cc699075..fa5e27a11 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java @@ -36,15 +36,11 @@ public class DefaultResult implements Result { @IRI("https://admin-shell.io/aas/3/0/Result/messages") protected List messages = new ArrayList<>(); - @IRI("https://admin-shell.io/aas/3/0/Result/success") - protected boolean success; - public DefaultResult() {} @Override public int hashCode() { - return Objects.hash(this.messages, - this.success); + return Objects.hash(this.messages); } @Override @@ -57,8 +53,7 @@ public boolean equals(Object obj) { return false; } else { DefaultResult other = (DefaultResult) obj; - return Objects.equals(this.messages, other.messages) && - Objects.equals(this.success, other.success); + return Objects.equals(this.messages, other.messages); } } @@ -72,22 +67,11 @@ public void setMessages(List messages) { this.messages = messages; } - @Override - public boolean getSuccess() { - return success; - } - - @Override - public void setSuccess(boolean success) { - this.success = success; - } - public String toString() { return String.format( "DefaultResult (" + "messages=%s," - + "success=%s," + ")", - this.messages, this.success); + this.messages); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java deleted file mode 100644 index 2e8c02671..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementAttributes.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementAttributes; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementAttributesBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementAttributes - * - */ - -@IRI("aas:SubmodelElementAttributes") -public class DefaultSubmodelElementAttributes implements SubmodelElementAttributes { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultSubmodelElementAttributes() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSubmodelElementAttributes other = (DefaultSubmodelElementAttributes) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultSubmodelElementAttributes (" + "kind=%s," - + ")", - this.kind); - } - - /** - * This builder class can be used to construct a DefaultSubmodelElementAttributes bean. - */ - public static class Builder extends SubmodelElementAttributesBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSubmodelElementAttributes newBuildingInstance() { - return new DefaultSubmodelElementAttributes(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java deleted file mode 100644 index 17c3c7613..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollectionMetadata.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollectionMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementCollectionMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollectionMetadata - * - */ - -@IRI("aas:SubmodelElementCollectionMetadata") -public class DefaultSubmodelElementCollectionMetadata implements SubmodelElementCollectionMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - public DefaultSubmodelElementCollectionMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSubmodelElementCollectionMetadata other = (DefaultSubmodelElementCollectionMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultSubmodelElementCollectionMetadata (" - + ")" - - ); - } - - /** - * This builder class can be used to construct a DefaultSubmodelElementCollectionMetadata bean. - */ - public static class Builder extends SubmodelElementCollectionMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSubmodelElementCollectionMetadata newBuildingInstance() { - return new DefaultSubmodelElementCollectionMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java deleted file mode 100644 index b68c51c1d..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementListMetadata.java +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModelType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelElementListMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package - * org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementListMetadata - * - */ - -@IRI("aas:SubmodelElementListMetadata") -public class DefaultSubmodelElementListMetadata implements SubmodelElementListMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementAttributes/kind") - protected ModellingKind kind; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/orderRelevant") - protected boolean orderRelevant; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/semanticIdListElement") - protected Reference semanticIdListElement; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/typeValueListElement") - protected ModelType typeValueListElement; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelElementListMetadata/valueTypeListElement") - protected DataTypeDefXsd valueTypeListElement; - - public DefaultSubmodelElementListMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.orderRelevant, - this.semanticIdListElement, - this.typeValueListElement, - this.valueTypeListElement, - this.kind, - this.embeddedDataSpecifications, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSubmodelElementListMetadata other = (DefaultSubmodelElementListMetadata) obj; - return Objects.equals(this.orderRelevant, other.orderRelevant) && - Objects.equals(this.semanticIdListElement, other.semanticIdListElement) && - Objects.equals(this.typeValueListElement, other.typeValueListElement) && - Objects.equals(this.valueTypeListElement, other.valueTypeListElement) && - Objects.equals(this.kind, other.kind) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public boolean getOrderRelevant() { - return orderRelevant; - } - - @Override - public void setOrderRelevant(boolean orderRelevant) { - this.orderRelevant = orderRelevant; - } - - @Override - public Reference getSemanticIdListElement() { - return semanticIdListElement; - } - - @Override - public void setSemanticIdListElement(Reference semanticIdListElement) { - this.semanticIdListElement = semanticIdListElement; - } - - @Override - public ModelType getTypeValueListElement() { - return typeValueListElement; - } - - @Override - public void setTypeValueListElement(ModelType typeValueListElement) { - this.typeValueListElement = typeValueListElement; - } - - @Override - public DataTypeDefXsd getValueTypeListElement() { - return valueTypeListElement; - } - - @Override - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement) { - this.valueTypeListElement = valueTypeListElement; - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultSubmodelElementListMetadata (" + "orderRelevant=%s," - + "semanticIdListElement=%s," - + "typeValueListElement=%s," - + "valueTypeListElement=%s," - + ")", - this.orderRelevant, this.semanticIdListElement, this.typeValueListElement, this.valueTypeListElement); - } - - /** - * This builder class can be used to construct a DefaultSubmodelElementListMetadata bean. - */ - public static class Builder extends SubmodelElementListMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSubmodelElementListMetadata newBuildingInstance() { - return new DefaultSubmodelElementListMetadata(); - } - } -} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java deleted file mode 100644 index a55a9650b..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelMetadata.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model.impl; - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelMetadata; -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; -import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelMetadataBuilder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - - -/** - * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelMetadata - * - */ - -@IRI("aas:SubmodelMetadata") -public class DefaultSubmodelMetadata implements SubmodelMetadata { - - @IRI("https://admin-shell.io/aas/3/0/HasDataSpecification/embeddedDataSpecifications") - protected List embeddedDataSpecifications = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasExtensions/extensions") - protected List extensions = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/semanticId") - protected Reference semanticId; - - @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") - protected List supplementalSemanticIds = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Identifiable/administration") - protected AdministrativeInformation administration; - - @IRI("https://admin-shell.io/aas/3/0/Identifiable/id") - protected String id; - - @IRI("https://admin-shell.io/aas/3/0/Qualifiable/qualifiers") - protected List qualifiers = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/category") - protected String category; - - @IRI("https://admin-shell.io/aas/3/0/Referable/description") - protected List description = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/displayName") - protected List displayName = new ArrayList<>(); - - @IRI("https://admin-shell.io/aas/3/0/Referable/idShort") - protected String idShort; - - @IRI("https://admin-shell.io/aas/3/0/SubmodelMetadata/kind") - protected ModellingKind kind; - - public DefaultSubmodelMetadata() {} - - @Override - public int hashCode() { - return Objects.hash(this.kind, - this.administration, - this.id, - this.category, - this.idShort, - this.displayName, - this.description, - this.extensions, - this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - DefaultSubmodelMetadata other = (DefaultSubmodelMetadata) obj; - return Objects.equals(this.kind, other.kind) && - Objects.equals(this.administration, other.administration) && - Objects.equals(this.id, other.id) && - Objects.equals(this.category, other.category) && - Objects.equals(this.idShort, other.idShort) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers); - } - } - - @Override - public ModellingKind getKind() { - return kind; - } - - @Override - public void setKind(ModellingKind kind) { - this.kind = kind; - } - - @Override - public AdministrativeInformation getAdministration() { - return administration; - } - - @Override - public void setAdministration(AdministrativeInformation administration) { - this.administration = administration; - } - - @Override - public String getId() { - return id; - } - - @Override - public void setId(String id) { - this.id = id; - } - - @Override - public String getCategory() { - return category; - } - - @Override - public void setCategory(String category) { - this.category = category; - } - - @Override - public String getIdShort() { - return idShort; - } - - @Override - public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - public List getDisplayName() { - return displayName; - } - - @Override - public void setDisplayName(List displayNames) { - this.displayName = displayNames; - } - - @Override - public List getDescription() { - return description; - } - - @Override - public void setDescription(List descriptions) { - this.description = descriptions; - } - - @Override - public List getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List extensions) { - this.extensions = extensions; - } - - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - public String toString() { - return String.format( - "DefaultSubmodelMetadata (" + "kind=%s," - + ")", - this.kind); - } - - /** - * This builder class can be used to construct a DefaultSubmodelMetadata bean. - */ - public static class Builder extends SubmodelMetadataBuilder { - - @Override - protected Builder getSelf() { - return this; - } - - @Override - protected DefaultSubmodelMetadata newBuildingInstance() { - return new DefaultSubmodelMetadata(); - } - } -} From a66a36131c30d63d6a33d9dd65ddd8c37fddbcef Mon Sep 17 00:00:00 2001 From: emildinchev <74680648+emildinchev@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:01:01 +0100 Subject: [PATCH 54/91] fix: improve serialization (#13) * fix: improve serialization * Fix the tests * Replace the newly introduced deserializer methods with generic methods * Update JsonDeserializer.java * Update JsonDeserializer.java * Add some unit tests * Fix the serialization tests * Fix the tests * Update JsonSerializer.java * Replace newly introduced method with a generic methods * Remove some not used mixins * Remove not used mixins * Remove not used mixins * Remove not used mixins --------- Co-authored-by: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com> --- .../v3/dataformat/json/JsonDeserializer.java | 243 +++++----------- .../v3/dataformat/json/JsonMapperFactory.java | 2 +- .../v3/dataformat/json/JsonSerializer.java | 265 +++++++----------- .../AnnotatedRelationshipElementMixin.java | 30 -- ...setAdministrationShellDescriptorMixin.java | 58 ---- .../mixins/AssetAdministrationShellMixin.java | 25 -- .../json/mixins/AssetInformationMixin.java | 32 --- .../v3/dataformat/json/mixins/BlobMixin.java | 24 -- .../json/mixins/ConceptDescriptionMixin.java | 30 -- .../DataSpecificationIec61360Mixin.java | 46 --- .../dataformat/json/mixins/EntityMixin.java | 32 --- .../json/mixins/EnvironmentMixin.java | 36 --- .../json/mixins/ExtensionMixin.java | 24 -- .../v3/dataformat/json/mixins/FileMixin.java | 24 -- .../mixins/HasDataSpecificationMixin.java | 37 --- .../json/mixins/HasSemanticsMixin.java | 27 -- .../json/mixins/IdentifiableMixin.java | 24 -- .../v3/dataformat/json/mixins/KeyMixin.java | 28 -- .../mixins/MultiLanguagePropertyMixin.java | 37 --- .../json/mixins/OperationMixin.java | 42 --- .../json/mixins/OperationVariableMixin.java | 25 -- .../dataformat/json/mixins/PropertyMixin.java | 28 -- .../json/mixins/QualifierMixin.java | 32 --- .../v3/dataformat/json/mixins/RangeMixin.java | 23 -- .../json/mixins/ReferableMixin.java | 36 --- .../json/mixins/ReferenceMixin.java | 36 --- .../json/mixins/RelationshipElementMixin.java | 27 -- .../json/mixins/SpecificAssetIdMixin.java | 28 -- .../json/mixins/SubmodelDescriptorMixin.java | 37 --- .../SubmodelElementCollectionMixin.java | 30 -- .../json/mixins/SubmodelElementListMixin.java | 61 ---- .../dataformat/json/mixins/SubmodelMixin.java | 50 ---- .../json/mixins/ValueReferencePairMixin.java | 28 -- ...rationShellDescriptorDeserializerTest.java | 5 +- ...strationShellDescriptorSerializerTest.java | 13 +- .../json/JsonReferableDeserializerTest.java | 54 +++- .../json/JsonReferableSerializerTest.java | 13 + .../json/JsonReferenceDeserializerTest.java | 13 +- .../json/JsonReferenceSerializerTest.java | 15 +- .../dataformat/json/JsonSerializerTest.java | 21 +- .../JsonSpecificAssetIdDeserializerTest.java | 20 +- .../JsonSpecificAssetIdSerializerTest.java | 18 +- ...sonSubmodelDescriptorDeserializerTest.java | 7 +- .../JsonSubmodelDescriptorSerializerTest.java | 6 +- .../ReflectionAnnotationIntrospectorTest.java | 17 +- 45 files changed, 281 insertions(+), 1428 deletions(-) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 710b7c4d1..d6405c6eb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -21,12 +21,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import java.io.File; import java.io.FileInputStream; @@ -54,111 +50,6 @@ public JsonDeserializer() { mapper = jsonMapperFactory.create(typeResolver); } - /** - * Deserializes a given string into instance of an AAS type - * - * @param value a string representation of the AAS instance - * @param valueType the class type of the AAS instance - * @param the AAS type - * @return the instance - * @throws DeserializationException if deserialization fails - */ - public T read(String value, Class valueType) throws DeserializationException { - try { - return mapper.readValue(value, valueType); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing "+ valueType.getSimpleName(), ex); - } - } - - /** - * Deserializes a given JSON node into instance of an AAS type - * - * @param node the node to parse - * @param valueType the class type of the AAS instance - * @param the AAS type - * @return an AAS instance - * - * @throws DeserializationException if deserialization fails - */ - public T read(JsonNode node, Class valueType) throws DeserializationException { - try { - return mapper.treeToValue(node, valueType); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); - } - } - - /** - * Deserializes a given InputStream into instance of an AAS type, using a given charset - * - * @param stream An InputStream containing the string representation of the AAS instance - * @param charset the charset to use for deserialization - * @param valueType the class type of the AAS instance - * @param the AAS type - * @return an AAS instance - * @throws DeserializationException if deserialization fails - */ - public T read(InputStream stream, Charset charset, Class valueType) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(stream, charset), valueType); - } catch (IOException ex) { - throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); - } - } - - /** - * Deserializes a given string into a list of AAS instances - * - * @param value a string representation of the AAS instances list - * @param valueType the class type of the instance - * @param the AAS type - * @return a list of AAS instances - * @throws DeserializationException if deserialization fails - */ - public List readList(String value, Class valueType) throws DeserializationException { - try { - return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); - } - } - - /** - * Deserializes a given JsonArray into a list of AAS instances - * - * @param node a JsonArray representing the AAS instances list - * @param valueType the class type of the instance - * @param the AAS type - * @return a list of AAS instances - * @throws DeserializationException if deserialization fails - */ - public List readList(JsonNode node, Class valueType) throws DeserializationException { - try { - return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); - } - } - - /** - * Deserializes a given input stream into a list of AAS instances - * - * @param stream An InputStream containing the string representation of the AAS instances list - * @param charset the charset to use for deserialization - * @param valueType the class type of the AAS instance - * @param the AAS type - * @return a list of AAS instances - * @throws DeserializationException if deserialization fails - */ - public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { - try { - return mapper.readValue(new InputStreamReader(stream, charset), - mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (Exception ex) { - throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); - } - } /** * Deserializes a given string into an instance of AAS environment @@ -270,7 +161,7 @@ public T readReferable(String src, Class outputClass) t */ public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + return read(src, DEFAULT_CHARSET, outputClass); } /** @@ -297,7 +188,7 @@ public T readReferable(JsonNode root, Class outputClass * @throws DeserializationException if deserialization fails */ public T readReferable(InputStream src, Charset charset, Class outputClass) - throws DeserializationException { + throws DeserializationException { return read(src, charset, outputClass); } @@ -313,7 +204,7 @@ public T readReferable(InputStream src, Charset charset, C */ public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + return read(new FileInputStream(src), DEFAULT_CHARSET, outputClass); } /** @@ -329,7 +220,7 @@ public T readReferable(File src, Class outputClass) */ public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + return read(new FileInputStream(src), charset, outputClass); } /** @@ -371,7 +262,7 @@ public List readReferables(JsonNode root, Class outp */ public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + return readList(src, DEFAULT_CHARSET, outputClass); } /** @@ -401,7 +292,7 @@ public List readReferables(InputStream src, Charset cha */ public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); + return readList(new FileInputStream(src), DEFAULT_CHARSET, outputClass); } /** @@ -421,92 +312,108 @@ public List readReferables(File src, Charset charset, C } /** - * Deserializes a given string into an instance of an AAS reference + * Generic method to deserialize a given string into instance of an AAS type * - * @param reference a string representation of an AAS reference - * @return an instance of the AAS reference - * @throws DeserializationException if deserialization fails - */ - public Reference readReference(String reference) throws DeserializationException { - return read(reference, Reference.class); - } - - /** - * Deserializes a given string into a list of AAS references - * - * @param references a string representation of the AAS references list - * @return a list of AAS references + * @param value a string representation of the AAS instance + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return the instance * @throws DeserializationException if deserialization fails */ - public List readReferences(String references) throws DeserializationException { - return readList(references, Reference.class); + public T read(String value, Class valueType) throws DeserializationException { + try { + return mapper.readValue(value, valueType); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing "+ valueType.getSimpleName(), ex); + } } /** - * Deserializes a given string into an instance of an AAS specific asset ID + * Generic method to deserialize a given JSON node into instance of an AAS type * - * @param specificAssetId a string representation of an AAS specific asset ID - * @return an instance of the AAS specific asset ID - * @throws DeserializationException if deserialization fails - */ - public SpecificAssetId readSpecificAssetId(String specificAssetId) throws DeserializationException { - return read(specificAssetId, SpecificAssetId.class); - } - - /** - * Deserializes a given string into a list of AAS references + * @param node the node to parse + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return an AAS instance * - * @param specificAssetIds a string representation of the AAS specific asset IDs - * @return a list of AAS specific asset IDs * @throws DeserializationException if deserialization fails */ - public List readSpecificAssetIds(String specificAssetIds) throws DeserializationException { - return readList(specificAssetIds, SpecificAssetId.class); + public T read(JsonNode node, Class valueType) throws DeserializationException { + try { + return mapper.treeToValue(node, valueType); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given string into an AAS submodel descriptor + * Generic method to deserialize a given InputStream into instance of an AAS type, using a given charset * - * @param submodelDescriptor a string representation of the AAS submodel descriptor - * @return an instance of AAS submodel descriptor + * @param stream An InputStream containing the string representation of the AAS instance + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return an AAS instance * @throws DeserializationException if deserialization fails */ - public SubmodelDescriptor readSubmodelDescriptor(String submodelDescriptor) throws DeserializationException { - return read(submodelDescriptor, SubmodelDescriptor.class); + public T read(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + try { + return mapper.readValue(new InputStreamReader(stream, charset), valueType); + } catch (IOException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given string into a list of AAS submodel descriptors + * Deserializes a given string into a list of AAS instances * - * @param submodelDescriptors a string representation of the submodel descriptors - * @return a list of AAS submodel descriptors + * @param value a string representation of the AAS instances list + * @param valueType the class type of the instance + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public List readSubmodelDescriptors(String submodelDescriptors) throws DeserializationException { - return readList(submodelDescriptors, SubmodelDescriptor.class); + public List readList(String value, Class valueType) throws DeserializationException { + try { + return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given string into an AAS submodel descriptor + * Deserializes a given JsonArray into a list of AAS instances * - * @param shellDescriptor a string representation of the AAS shell descriptor - * @return an instance of AAS shell descriptor + * @param node a JsonArray representing the AAS instances list + * @param valueType the class type of the instance + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public AssetAdministrationShellDescriptor readAssetAdministrationShellDescriptor(String shellDescriptor) - throws DeserializationException { - return read(shellDescriptor, AssetAdministrationShellDescriptor.class); + public List readList(JsonNode node, Class valueType) throws DeserializationException { + try { + return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given string into a list of AAS shell descriptors + * Deserializes a given input stream into a list of AAS instances * - * @param shellDescriptors a string representation of the AAS shell descriptors - * @return a list of AAS shell descriptors + * @param stream An InputStream containing the string representation of the AAS instances list + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public List readAssetAdministrationShellDescriptors(String shellDescriptors) - throws DeserializationException { - return readList(shellDescriptors, AssetAdministrationShellDescriptor.class); + public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + try { + return mapper.readValue(new InputStreamReader(stream, charset), + mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (Exception ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } } } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index 5cac6ae39..b6f7da5aa 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -44,7 +44,7 @@ public JsonMapper create(SimpleAbstractTypeResolver typeResolver) { Builder builder = JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .annotationIntrospector(new ReflectionAnnotationIntrospector()) - .serializationInclusion(JsonInclude.Include.NON_NULL); + .serializationInclusion(JsonInclude.Include.NON_EMPTY); getModulesToInstall(typeResolver).stream().forEach(m -> builder.addModule(m)); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 95906678c..cde848c5a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -16,10 +16,8 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.json.JsonMapper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; @@ -29,6 +27,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -40,13 +39,10 @@ import java.util.List; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to - * JSON. + * Class for serializing of AAS instances. */ public class JsonSerializer { - protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonSerializer() { @@ -54,74 +50,62 @@ public JsonSerializer() { } /** - * Serializes a given instance of AssetAdministrationShellEnvironment to string + * Serializes a given instance of AAS environment to a string * - * @param aasEnvironment the AssetAdministrationShellEnvironment to serialize + * @param aasEnvironment the AAS environment to serialize * @return the string representation of the environment * @throws SerializationException if serialization fails */ public String write(Environment aasEnvironment) throws SerializationException { - try { - return mapper.writeValueAsString(aasEnvironment); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); - } + return write((Object)aasEnvironment); } /** - * Converts a given instance of AssetAdministrationShellEnvironment as JSON node. + * Converts a given instance of AAS environment to a JSON node * - * @param aasEnvironment the AssetAdministrationShellEnvironment to serialize - * @return the JSON node representation of the environment + * @param aasEnvironment the AAS environment to serialize + * @return the JSON node representation + * @throws IllegalArgumentException */ public JsonNode toNode(Environment aasEnvironment) { - return mapper.valueToTree(aasEnvironment); + return toNode((Object)aasEnvironment); } /** - * Serializes a given instance of Environment to an OutputStream using DEFAULT_CHARSET + * Serializes a given AAS environment to an output stream using given charset * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to serialize - * @throws IOException if writing to the stream fails + * @param out the output stream to serialize to + * @param aasEnvironment the AAS environment to serialize * @throws SerializationException if serialization fails */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); + void write(OutputStream out, Environment aasEnvironment) throws SerializationException { + write(out, DEFAULT_CHARSET, (Object)aasEnvironment); } /** - * Serializes a given instance of Environment to an OutputStream using given charset + * Serializes a given AAS environment to an output stream using given charset * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to serialize - * @throws IOException if writing to the stream fails + * @param out the output stream to serialize to + * @param charset the charset to use for serialization + * @param aasEnvironment the AAS environment to serialize * @throws SerializationException if serialization fails */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); - } + void write(OutputStream out, Charset charset, Environment aasEnvironment) throws SerializationException { + write(out, charset, (Object)aasEnvironment); } - // Note that the AAS also defines a file class /** - * Serializes a given instance of Environment to a java.io.File using DEFAULT_CHARSET + * Serializes a given instance of AAS environment to a java.io.File using DEFAULT_CHARSET * * @param file the java.io.File to serialize to * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to serialize + * @param aasEnvironment the AAS environment to serialize * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails * @throws SerializationException if serialization fails */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); - } + void write(File file, Charset charset, Environment aasEnvironment) + throws FileNotFoundException, SerializationException { + write(new FileOutputStream(file), charset, aasEnvironment); } /** @@ -130,11 +114,10 @@ void write(java.io.File file, Charset charset, Environment aasEnvironment) * @param file the java.io.File to serialize to * @param aasEnvironment the Environment to serialize * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails * @throws SerializationException if serialization fails */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { + void write(File file, Environment aasEnvironment) + throws FileNotFoundException, SerializationException { write(file, DEFAULT_CHARSET, aasEnvironment); } @@ -146,11 +129,7 @@ void write(java.io.File file, Environment aasEnvironment) * @throws SerializationException if serialization fails */ public String write(Referable referable) throws SerializationException { - try { - return mapper.writeValueAsString(referable); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } + return write((Object)referable); } /** @@ -160,156 +139,112 @@ public String write(Referable referable) throws SerializationException { * @return the JSON node representation of the referable */ public JsonNode toNode(Referable referable) { - return mapper.valueToTree(referable); + return toNode((Object)referable); } /** - * - * @param referables the referables to serialize - * @return the string representation of the list of referables + * Serializes a given collection of referables to string + * @param referables the collection of referables to serialize + * @return the string representation of the collection * @throws SerializationException if serialization fails */ public String write(Collection referables) throws SerializationException { - if (referables == null) { - return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } - - try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); - } + return writeList(referables); } /** - * + * Converts a collection of referables to a JSON node. * @param referables the referables to serialize * @return the string representation of the list of referables */ public JsonNode toNode(Collection referables) { - if (referables == null) { - return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode(); - } - return mapper.valueToTree(referables); + return toNode((Object)referables); } + /** + * Serializes a referable to string. + * @param referable the referable to serialize. + * @return the string representation. + * @throws SerializationException + */ public String writeReferable(Referable referable) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(referable)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } + return write(referable); } + /** + * Serializes a collection of referables + * @param referables the collection to serialize + * @return the string representation. + * @throws SerializationException + */ public String writeReferables(List referables) throws SerializationException { - if(referables.isEmpty()){ - return "[]"; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); - return objectWriter.writeValueAsString(referables); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); - } + return write(referables); } - public String writeReference(Reference reference) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(reference)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - public String writeReferences(List references) throws SerializationException { - if(references.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, Reference.class)); - return objectWriter.writeValueAsString(references); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of References", ex); - } - } - - public String writeSpecificAssetId(SpecificAssetId specificAssetId) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(specificAssetId)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SpecificAssetId", ex); - } - } - - - public String writeSpecificAssetIds(List specificAssetIds) throws SerializationException { - if(specificAssetIds.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SpecificAssetId.class)); - return objectWriter.writeValueAsString(specificAssetIds); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SpecificAssetIds", ex); - } - } - - - public String writeSubmodelDescriptor(SubmodelDescriptor submodelDescriptor) throws SerializationException { + /** + * Generic method to serialize a given object to a string + * + * @param aasInstance the object to serialize + * @return the string representation + * @throws SerializationException if serialization fails + */ + public String write(Object aasInstance) throws SerializationException { try { - return mapper.writeValueAsString(mapper.valueToTree(submodelDescriptor)); + return mapper.writeValueAsString(aasInstance); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing SubmodelDescriptor", ex); + throw new SerializationException( + String.format("error serializing %s", aasInstance.getClass().getSimpleName()), ex); } } - - public String writeSubmodelDescriptors(List submodelDescriptors) throws SerializationException { - if(submodelDescriptors.isEmpty()){ - return null; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, SubmodelDescriptor.class)); - return objectWriter.writeValueAsString(submodelDescriptors); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of SubmodelDescriptors", ex); - } + /** + * Generic method to convert a given object to a JSON node + * + * @param aasInstance the object to serialize + * @return the JSON node representation + * @throws IllegalArgumentException + */ + public JsonNode toNode(Object aasInstance) { + return mapper.valueToTree(aasInstance); } - - public String writeAssetAdministrationShellDescriptor(AssetAdministrationShellDescriptor assetAdministrationShellDescriptor) throws SerializationException { + /** + * Generic method to serialize a given object to an output stream using given charset + * + * @param out the output stream to serialize to + * @param charset the charset to use for serialization + * @param aasInstance the object to serialize + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Charset charset, Object aasInstance) throws SerializationException { try { - return mapper.writeValueAsString(mapper.valueToTree(assetAdministrationShellDescriptor)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellDescriptor", ex); + mapper.writeValue(new OutputStreamWriter(out, charset), aasInstance); + } catch (IOException ex) { + throw new SerializationException("error serializing " + aasInstance.getClass().getSimpleName() , ex); } } - - public String writeAssetAdministrationShellDescriptors(List assetAdministrationShellDescriptors) throws SerializationException { - if(assetAdministrationShellDescriptors.isEmpty()){ - return null; + /** + * Generic method to serialize a collection. + * @param collection the collection to serialize + * @return the string representation of the collection. + * @throws SerializationException if serialization fails + */ + public String writeList(Collection collection) throws SerializationException { + if (collection == null || collection.isEmpty()) { + try { + return mapper.writeValueAsString(collection); + } catch (JsonProcessingException e) { + throw new SerializationException("error serializing list"); + } } + Class clazz = collection.iterator().next().getClass(); try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, AssetAdministrationShellDescriptor.class)); - return objectWriter.writeValueAsString(assetAdministrationShellDescriptors); - + return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) + .writeValueAsString(collection); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of AssetAdministrationShellDescriptors", ex); + throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); } } -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java deleted file mode 100644 index d4e1e6730..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -public interface AnnotatedRelationshipElementMixin { - - @JsonProperty("annotations") - List getAnnotations(); - - @JsonProperty("annotations") - void setAnnotations(List annotations); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java deleted file mode 100644 index a503d4de8..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellDescriptorMixin.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.util.List; - -public interface AssetAdministrationShellDescriptorMixin { - - @JsonProperty("idShort") - String getIdShort(); - - @JsonProperty("idShort") - void setIdShort(String idShort); - - @JsonProperty("description") - List getDescription(); - - @JsonProperty("description") - void setDescription(List description); - - @JsonProperty("displayName") - List getDisplayName(); - - @JsonProperty("displayName") - void setDisplayName(List displayName); - - @JsonProperty("submodelDescriptors") - List getSubmodelDescriptor(); - - @JsonProperty("submodelDescriptors") - void setSubmodelDescriptor(List submodelDescriptor); - - @JsonProperty("specificAssetIds") - List getSpecificAssetIds(); - - @JsonProperty("specificAssetIds") - void setSpecificAssetIds(List specificAssetIds); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java deleted file mode 100644 index 0d6c16532..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; - -public interface AssetAdministrationShellMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - AssetInformation getAssetInformation(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java deleted file mode 100644 index 810b7232c..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; - -public interface AssetInformationMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); - - @JsonProperty("globalAssetId") - public String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - public void setGlobalAssetId(String globalAssetId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java deleted file mode 100644 index e64dff105..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; - -public interface BlobMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - String getMimeType(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java deleted file mode 100644 index 3b31ea790..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface ConceptDescriptionMixin { - - @JsonProperty("isCaseOf") - public List getIsCaseOf(); - - @JsonProperty("isCaseOf") - public void setIsCaseOf(List isCaseOf); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java deleted file mode 100644 index 2d3281b2c..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface DataSpecificationIec61360Mixin { - - @JsonProperty("levelType") - public List getLevelTypes(); - - @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("preferredName") - public List getPreferredName(); - - @JsonProperty("preferredName") - public void setPreferredName(List preferredName); - - @JsonProperty("unitId") - public Reference getUnitId(); - - @JsonProperty("unitId") - public void setUnitId(Reference unitId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java deleted file mode 100644 index edc862bf9..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; - -public interface EntityMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - public EntityType getEntityType(); - - @JsonProperty("globalAssetId") - public String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - public void setGlobalAssetId(String globalAssetId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java deleted file mode 100644 index 620a2ac69..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; - -import java.util.List; -import java.util.Set; - -public interface EnvironmentMixin { - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - Set getAssetAdministrationShells(); - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - List getSubmodels(); - - @JsonInclude(JsonInclude.Include.NON_EMPTY) - List getConceptDescriptions(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java deleted file mode 100644 index 9c84906bd..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; - -public interface ExtensionMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - String getName(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java deleted file mode 100644 index b5780799d..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; - -public interface FileMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - String getContentType(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java deleted file mode 100644 index c1fa34770..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface HasDataSpecificationMixin { - - @JsonProperty("embeddedDataSpecifications") - List getEmbeddedDataSpecifications(); - - @JsonProperty("embeddedDataSpecifications") - void setEmbeddedDataSpecifications(List embeddedDataSpecifications); - - @JsonProperty("dataSpecifications") - List getDataSpecifications(); - - @JsonProperty("dataSpecifications") - void setDataSpecifications(List dataSpecifications); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java deleted file mode 100644 index 574e3e035..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 jab. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface HasSemanticsMixin { - @JsonProperty("semanticId") - public Reference getSemanticId(); - - @JsonProperty("semanticId") - public void setSemanticId(Reference semanticId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java deleted file mode 100644 index 2d203c018..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; - -public interface IdentifiableMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - String getId(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java deleted file mode 100644 index a600b260c..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; - -public interface KeyMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - KeyTypes getType(); - - @JsonInclude(JsonInclude.Include.ALWAYS) - String getValue(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java deleted file mode 100644 index 50f7c3383..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface MultiLanguagePropertyMixin { - - @JsonProperty("value") - public List getValue(); - - @JsonProperty("value") - public void setValue(LangStringTextType value); - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java deleted file mode 100644 index ff36cd855..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.util.List; - -public interface OperationMixin { - - @JsonProperty("inputVariables") - List getInputVariables(); - - @JsonProperty("inputVariables") - void setInputVariables(List inputVariables); - - @JsonProperty("inoutputVariables") - List getInoutputVariables(); - - @JsonProperty("inoutputVariables") - void setInoutputVariables(List inoutputVariables); - - @JsonProperty("outputVariables") - List getOutputVariables(); - - @JsonProperty("outputVariables") - void setOutputVariables(List outputVariables); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java deleted file mode 100644 index 608df9adb..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -public interface OperationVariableMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - SubmodelElement getValue(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java deleted file mode 100644 index 328276991..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface PropertyMixin { - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java deleted file mode 100644 index 3e1efbdef..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface QualifierMixin { - - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getType(); - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java deleted file mode 100644 index d7b609ac4..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; - -public interface RangeMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - String getValueType(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java deleted file mode 100644 index 9131120f1..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - -import java.util.List; - -public interface ReferableMixin { - @JsonProperty("description") - List getDescription(); - - @JsonProperty("description") - void setDescription(List description); - - @JsonProperty("displayName") - List getDisplayName(); - - @JsonProperty("displayName") - void setDisplayName(List displayNames); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java deleted file mode 100644 index b9be2c816..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; - -import java.util.List; - -public interface ReferenceMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("keys") - List getKeys(); - - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("type") - ReferenceTypes getType(); - - @JsonProperty("type") - void setType(ReferenceTypes type); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java deleted file mode 100644 index 5bbd6c537..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface RelationshipElementMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - Reference getFirst(); - - @JsonInclude(JsonInclude.Include.ALWAYS) - Reference getSecond(); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java deleted file mode 100644 index ae379d373..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 jab. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface SpecificAssetIdMixin { - - @JsonProperty("externalSubjectId") - public Reference getExternalSubjectId(); - - @JsonProperty("externalSubjectId") - public void setExternalSubjectId(Reference reference); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java deleted file mode 100644 index 23729b25e..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelDescriptorMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - -import java.util.List; - -public interface SubmodelDescriptorMixin { - @JsonProperty("description") - List getDescription(); - - @JsonProperty("description") - void setDescription(List description); - - @JsonProperty("displayName") - List getDisplayName(); - - @JsonProperty("displayName") - void setDisplayName(List displayName); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java deleted file mode 100644 index f56304f81..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; - -public interface SubmodelElementCollectionMixin { - - @JsonProperty("value") - public Collection getValue(); - - @JsonProperty("value") - public void setValue(Collection values); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java deleted file mode 100644 index 7f3492674..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; - -public interface SubmodelElementListMixin { - - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - public boolean getOrdered(); - - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - public void setOrdered(boolean orderRelevant); - - @JsonProperty("semanticIdListElement") - public Reference getSemanticIdListElement(); - - @JsonProperty("semanticIdListElement") - public void setSemanticIdListElement(Reference semanticIdListElement); - - @JsonProperty("typeValueListElement") - public AasSubmodelElements getTypeValueListElement(); - - @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AasSubmodelElements typeValueListElement); - - @JsonProperty("valueTypeListElement") - public DataTypeDefXsd getValueTypeListElement(); - - @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); - - @JsonProperty("value") - public Collection getValue(); - - @JsonProperty("value") - public void setValue(Collection value); -} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java deleted file mode 100644 index ab0f9faee..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - -import java.util.List; - -public interface SubmodelMixin { - @JsonProperty("idShort") - public String getIdShort(); - - @JsonProperty("idShort") - public void setIdShort(String idShort); - - @JsonProperty("description") - public List getDescription(); - - @JsonProperty("description") - public void setDescription(List description); - - @JsonProperty("displayName") - public List getDisplayName(); - - @JsonProperty("displayName") - public void setDisplayName(List displayName); - - @JsonProperty("extensions") - List getExtensions(); - - @JsonProperty("extensions") - void setExtensions(List extensions); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java deleted file mode 100644 index 8a8b08338..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 jab. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface ValueReferencePairMixin { - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java index aa6c4dcb9..f44ed544d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java @@ -65,7 +65,8 @@ public static AssetAdministrationShellDescriptor createAasDescriptor() { public void testReadAasDescriptor() throws IOException, DeserializationException { File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = new JsonDeserializer().readAssetAdministrationShellDescriptor(expected); + AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = + new JsonDeserializer().read(expected, AssetAdministrationShellDescriptor.class); AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); assertEquals(aasExpected, assetAdministrationShellDescriptor); @@ -77,7 +78,7 @@ public void testReadAasDescriptorsList() throws IOException, DeserializationExce File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; List assetAdministrationShellDescriptors = - new JsonDeserializer().readAssetAdministrationShellDescriptors(expected); + new JsonDeserializer().readList(expected, AssetAdministrationShellDescriptor.class); AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java index 39774e7ee..48fd5c528 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java @@ -17,8 +17,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.json.JSONException; +import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; @@ -33,25 +35,22 @@ import static org.junit.Assert.assertTrue; public class JsonAssetAdministrationShellDescriptorSerializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorSerializerTest.class); - @Test public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/assetAdministrationShellDescriptor.json"); - + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); + Assert.assertTrue(fileExpected.exists()); validateAndCompare(fileExpected, JsonAssetAdministrationShellDescriptorDeserializerTest.createAasDescriptor()); } private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().writeAssetAdministrationShellDescriptor(descriptor); + String actual = new JsonSerializer().write(descriptor); logger.debug(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java index 40336613a..8a0cd6aec 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java @@ -35,53 +35,91 @@ import org.junit.Ignore; import org.junit.Test; +import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class JsonReferableDeserializerTest { @Test - public void testReadAAS() throws IOException, DeserializationException { + public void testReadAAS() throws DeserializationException { AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); } @Test - public void testReadAASs() throws IOException, DeserializationException { + public void testReadAASs() throws DeserializationException { List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); } @Test - public void testReadSubmodel() throws IOException, DeserializationException { + public void testReadSubmodelUsingUtf8Charset() throws DeserializationException { + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { + Submodel expected = Examples.SUBMODEL.getModel(); + File file = new File("src/test/resources/Submodel.json"); + assertTrue(file.exists()); + Submodel actual = new JsonDeserializer().readReferable(file, StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + + @Test + public void testReadSubmodelsFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + File file = new File("src/test/resources/Submodel-List.json"); + assertTrue(file.exists()); + List actual = new JsonDeserializer().readReferables(file, StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelsFromStreamUsingUtf8Charset() throws DeserializationException { + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readReferables( + Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodel() throws DeserializationException { Submodel expected = Examples.SUBMODEL.getModel(); Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); assertEquals(expected, actual); } @Test - public void testReadSubmodels() throws IOException, DeserializationException { + public void testReadSubmodels() throws DeserializationException { List expected = Examples.SUBMODEL_LIST_OF.getModel(); List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); assertEquals(expected, actual); } @Test - public void testReadSubmodelElement() throws IOException, DeserializationException { + public void testReadSubmodelElement() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); assertEquals(expected, actual); } @Test - public void testReadSubmodelElements() throws IOException, DeserializationException { + public void testReadSubmodelElements() throws DeserializationException { List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); List actual = new JsonDeserializer().readReferables( Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); @@ -89,14 +127,14 @@ public void testReadSubmodelElements() throws IOException, DeserializationExcept } @Test - public void testReadSubmodelElementList() throws IOException, DeserializationException { + public void testReadSubmodelElementList() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); assertEquals(expected, actual); } @Test - public void testReadSubmodelElementCollection() throws IOException, DeserializationException { + public void testReadSubmodelElementCollection() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); assertEquals(expected, actual); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java index a57394953..4ddf10b34 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java @@ -40,6 +40,7 @@ import org.skyscreamer.jsonassert.JSONCompareMode; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -122,6 +123,18 @@ public void testSerializePropertyToNode() throws IOException, SerializationExcep JsonNode actual = new JsonSerializer().toNode(property); Assert.assertEquals(expected, actual); } + + @Test + public void testSerializeListOfReferablesToNode() throws IOException, SerializationException, JSONException { + List referables = new ArrayList<>(); + referables.add(new DefaultProperty.Builder() + .idShort("exampleId") + .build()); + JsonNode node = new JsonSerializer().toNode(referables); + Assert.assertNotNull(node); + Assert.assertTrue(node.isArray()); + } + @Test public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { compare(Examples.EXTENSION_MINIMAL); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java index 9964fc69a..f0b26f06f 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java @@ -37,26 +37,21 @@ public class JsonReferenceDeserializerTest { @Before public void prepare() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); - reference_string = serializer.writeReference(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); - reference_list_string = serializer.writeReferences(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); + reference_string = serializer.write(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); + reference_list_string = serializer.writeList(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); } @Test public void testDeserializeReference() throws DeserializationException { JsonDeserializer deserializer = new JsonDeserializer(); - - Reference reference = deserializer.readReference(reference_string); - + Reference reference = deserializer.read(reference_string, Reference.class); assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); } - @Test public void testDeserializeReferenceList() throws DeserializationException { JsonDeserializer deserializer = new JsonDeserializer(); - - List referenceList = deserializer.readReferences(reference_list_string); - + List referenceList = deserializer.readList(reference_list_string, Reference.class); assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); } } \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java index 1c60012c4..92d093257 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java @@ -31,30 +31,19 @@ public class JsonReferenceSerializerTest { private static final Logger logger = LoggerFactory.getLogger(JsonReferenceSerializerTest.class); - - @Test public void testSerializeReference() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); - Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); - - String serializedReference = serializer.writeReference(reference); - + String serializedReference = serializer.write(reference); assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); } - - @Test public void testSerializeReferenceList() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); - List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); - - String serializedReferenceArray = serializer.writeReferences(referenceList); - + String serializedReferenceArray = serializer.write(referenceList); assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); } - } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index dfd22388a..5f71930eb 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -49,26 +49,26 @@ import static org.junit.Assert.assertTrue; public class JsonSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testSerializeNull() throws JsonProcessingException, IOException, SerializationException { - assertEquals("null", new JsonSerializer().write((Environment) null)); + public void testSerializeNull() throws SerializationException { + Environment env = null; + assertEquals("null", new JsonSerializer().write(env)); } @Test - public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { + public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); new JsonSerializer().write(file, AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test - public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { + public void testSerializeEmpty() throws IOException, SerializationException, JSONException { validateAndCompare(Examples.ENVIRONMENT_EMPTY); } @@ -83,7 +83,7 @@ public void testSerializeFullExample() throws SerializationException, JSONExcept } @Test - public void testSerializeFullExampleToNode() throws SerializationException, JSONException, IOException { + public void testSerializeFullExampleToNode() throws JSONException, IOException { String expected = Examples.EXAMPLE_FULL.fileContent(); JsonNode node = new JsonSerializer().toNode(Examples.EXAMPLE_FULL.getModel()); String actual = new ObjectMapper().writeValueAsString(node); @@ -91,10 +91,10 @@ public void testSerializeFullExampleToNode() throws SerializationException, JSON } @Test - public void testSerializeEmptyReferableList() throws SerializationException { + public void testSerializeEmptyReferableList() throws SerializationException, JSONException { List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); - assertEquals("[]", serialized); + String actual = new JsonSerializer().write(emptyList); + JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); } /** @@ -130,12 +130,11 @@ private void validateAndCompare(ExampleData exampleData) throws IOE validateAndCompare(expected, actual); } - private void validateAndCompare(String expected, String actual) throws IOException, SerializationException, JSONException { + private void validateAndCompare(String expected, String actual) throws JSONException { logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } - } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java index 9ee7c27b8..844fda8e9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java @@ -31,9 +31,6 @@ import static org.junit.Assert.assertTrue; public class JsonSpecificAssetIdDeserializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdDeserializerTest.class); - private String specificAssetId_string; private String specificAssetId_list_string; @@ -46,22 +43,20 @@ public void prepare() throws SerializationException { .name("testSpecificAssetId") .value("testValue") .build(); - List specificAssetIds = new ArrayList() {{ + List specificAssetIds = new ArrayList<>() {{ add(specificAssetId); add(specificAssetId); }}; - specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); - specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); + specificAssetId_string = serializer.write(specificAssetId); + specificAssetId_list_string = serializer.writeList(specificAssetIds); } @Test public void testDeserializeReference() throws DeserializationException { JsonDeserializer deserializer = new JsonDeserializer(); - - SpecificAssetId specificAssetId = deserializer.readSpecificAssetId(specificAssetId_string); - + SpecificAssetId specificAssetId = deserializer.read(specificAssetId_string, SpecificAssetId.class); assertTrue(!specificAssetId.getValue().isEmpty()); } @@ -69,11 +64,8 @@ public void testDeserializeReference() throws DeserializationException { @Test public void testDeserializeReferenceList() throws DeserializationException { JsonDeserializer deserializer = new JsonDeserializer(); - - List specificAssetIdList = deserializer.readSpecificAssetIds(specificAssetId_list_string); - + List specificAssetIdList = deserializer.readList( + specificAssetId_list_string, SpecificAssetId.class); assertTrue(specificAssetIdList.get(0).getValue().equalsIgnoreCase("testvalue")); } - - } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java index 39e2a0b11..7460a4bb0 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java @@ -29,9 +29,6 @@ import static org.junit.Assert.assertTrue; public class JsonSpecificAssetIdSerializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonSpecificAssetIdSerializerTest.class); - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() .name("testSpecificAssetId") .value("testValue") @@ -41,28 +38,21 @@ public class JsonSpecificAssetIdSerializerTest { @Test public void testSerializeSpecificAssetId() throws SerializationException { JsonSerializer serializer = new JsonSerializer(); - - String specificAssetId_string = serializer.writeSpecificAssetId(specificAssetId); - + String specificAssetId_string = serializer.write(specificAssetId); assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); } @Test public void testSerializeSpecificAssetIdList() throws SerializationException { - - List specificAssetIds = new ArrayList() {{ + List specificAssetIds = new ArrayList<>() {{ add(specificAssetId); add(specificAssetId); }}; JsonSerializer serializer = new JsonSerializer(); - - String specificAssetId_list_string = serializer.writeSpecificAssetIds(specificAssetIds); - + String specificAssetId_list_string = serializer.writeList(specificAssetIds); assertTrue(specificAssetId_list_string.startsWith("[")); assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); } - - -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index df5ab45a2..917065fb7 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -46,7 +46,7 @@ public static SubmodelDescriptor getDefaultSubmodelDescriptor () { public void testReadSubmodelDescriptor() throws IOException, DeserializationException { File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); - SubmodelDescriptor submodelDescriptor = new JsonDeserializer().readSubmodelDescriptor(expected); + SubmodelDescriptor submodelDescriptor = new JsonDeserializer().read(expected, SubmodelDescriptor.class); SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptor); @@ -56,8 +56,9 @@ public void testReadSubmodelDescriptor() throws IOException, DeserializationExce public void testReadSubmodelDescriptors() throws IOException, DeserializationException { File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; - List submodelDescriptors = new JsonDeserializer().readSubmodelDescriptors(expected); + List submodelDescriptors = + new JsonDeserializer().readList(expected, SubmodelDescriptor.class); SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); } -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java index 03acb794d..3ca7ba0cb 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -33,21 +33,17 @@ import static org.junit.Assert.assertTrue; public class JsonSubmodelDescriptorSerializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonSubmodelDescriptorSerializerTest.class); - @Test public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { File fileExpected = new File("src/test/resources/submodelDescriptor.json"); - validateAndCompare(fileExpected, JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor()); } private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().writeSubmodelDescriptor(descriptor); + String actual = new JsonSerializer().write(descriptor); logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index 7b659c9f8..e632dd607 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -28,7 +28,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.eclipse.digitaltwin.aas4j.v3.model.ClassA; import org.eclipse.digitaltwin.aas4j.v3.model.ClassB; import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; @@ -59,7 +58,7 @@ public class ReflectionAnnotationIntrospectorTest { private static ObjectMapper mapper; @Before - public void setUp() throws Exception { + public void setUp() { introspector = new ReflectionAnnotationIntrospector(); mapper = new ObjectMapper(); } @@ -79,18 +78,17 @@ private TypeResolverBuilder getTypeResolver(Class clazz) { } @Test - public void testFindTypeNameForClassesWithoutTypeInfo() throws Exception { + public void testFindTypeNameForClassesWithoutTypeInfo() { List.of(String.class, Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> assertNull(introspector.findTypeName(getAnnotatedClass(x)))); } @Test - public void testFindTypeNameForClassesWithTypeInfo() throws Exception { + public void testFindTypeNameForClassesWithTypeInfo() { Map.of(CustomProperty.class, Property.class, CustomSubProperty.class, Property.class, TypedProperty.class, TypedProperty.class, @@ -104,12 +102,11 @@ public void testFindTypeNameForClassesWithTypeInfo() throws Exception { } @Test - public void testFindTypeResolverForClassesWithoutTypeInfo() throws Exception { + public void testFindTypeResolverForClassesWithoutTypeInfo() { List.of(String.class, Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> { TypeResolverBuilder typeResolver = getTypeResolver(x); @@ -118,7 +115,7 @@ public void testFindTypeResolverForClassesWithoutTypeInfo() throws Exception { } @Test - public void testFindTypeResolverForClassesWithTypeInfo() throws Exception { + public void testFindTypeResolverForClassesWithTypeInfo() { List.of(CustomProperty.class, CustomSubProperty.class, TypedProperty.class, @@ -141,7 +138,6 @@ public void testFindSubtypesForExternalClasses() throws Exception { Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> { List subtypes = introspector.findSubtypes(getAnnotatedClass(x)); @@ -181,5 +177,4 @@ public void testFindSubtypesForInterfacesWithSubtypes() throws Exception { assertTrue(!subtypes.isEmpty()); }); } - -} +} \ No newline at end of file From 90df134a5bee202d5b3b9599d0cbb091b956e062 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 23 Jan 2024 14:29:34 +0100 Subject: [PATCH 55/91] Update JsonSubmodelDescriptorDeserializerTest.java --- .../dataformat/json/JsonSubmodelDescriptorDeserializerTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java index 917065fb7..6a0e75c8e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java @@ -29,7 +29,6 @@ import static org.junit.Assert.assertEquals; public class JsonSubmodelDescriptorDeserializerTest { - public static SubmodelDescriptor getDefaultSubmodelDescriptor () { return new DefaultSubmodelDescriptor.Builder() .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) From 5916dda772a980359386b32eeecda2b285d99ab3 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Tue, 23 Jan 2024 14:36:45 +0100 Subject: [PATCH 56/91] Update JsonSubmodelDescriptorSerializerTest.java --- .../dataformat/json/JsonSubmodelDescriptorSerializerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java index 3ca7ba0cb..44318976b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java @@ -37,7 +37,7 @@ public class JsonSubmodelDescriptorSerializerTest { @Test public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/submodelDescriptor.json"); + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); validateAndCompare(fileExpected, JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor()); } From fbeba1d0dfef9436a104aad4d5cb4cc58b018241 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 24 Jan 2024 13:30:24 +0100 Subject: [PATCH 57/91] Fix the build --- .../digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index ffa253814..a63996f31 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -39,6 +39,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; /** * The AASX package converter converts a aasx package into a list of aas, a list From d05c2a20dd85fb477fe50b4dbebe796add8a8047 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 13:49:26 +0100 Subject: [PATCH 58/91] Use only generic methods --- .../v3/dataformat/json/JsonDeserializer.java | 276 ++------------- .../v3/dataformat/json/JsonSerializer.java | 171 ++------- ...rationShellDescriptorDeserializerTest.java | 86 ----- ...strationShellDescriptorSerializerTest.java | 56 --- .../dataformat/json/JsonDeserializerTest.java | 329 +++++++++++++++++- .../json/JsonDurationDeserializerTest.java | 63 ---- .../json/JsonReferableDeserializerTest.java | 187 ---------- .../json/JsonReferableSerializerTest.java | 163 --------- .../json/JsonReferenceDeserializerTest.java | 57 --- .../json/JsonReferenceSerializerTest.java | 49 --- .../dataformat/json/JsonSerializerTest.java | 225 +++++++++++- .../JsonSpecificAssetIdDeserializerTest.java | 71 ---- .../JsonSpecificAssetIdSerializerTest.java | 58 --- ...sonSubmodelDescriptorDeserializerTest.java | 63 ---- .../JsonSubmodelDescriptorSerializerTest.java | 53 --- .../v3/dataformat/json/TestDataHelper.java | 9 + 16 files changed, 598 insertions(+), 1318 deletions(-) delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index d6405c6eb..ffccd8474 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -21,12 +21,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -50,77 +45,6 @@ public JsonDeserializer() { mapper = jsonMapperFactory.create(typeResolver); } - - /** - * Deserializes a given string into an instance of AAS environment - * - * @param value a string representation of the AAS environment - * @return an instance of AAS environment - * @throws DeserializationException if deserialization fails - */ - public Environment read(String value) throws DeserializationException { - return read(value, Environment.class); - } - - /** - * Deserializes a given JSON node into an instance of AAS environment - * @param root root node of the document to parse - * @return an instance of AAS environment - * @throws DeserializationException if deserialization fails - */ - public Environment read(JsonNode root) throws DeserializationException { - return read(root, Environment.class); - } - - /** - * Deserializes a given InputStream into an instance of AAS environment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the AAS environment - * @return an instance of AAS environment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of AAS environment using a given charset - * - * @param src An InputStream containing the string representation of the AAS environment - * @param charset the charset to use for deserialization - * @return an instance of AAS environment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(src, charset, Environment.class); - } - - /** - * Deserializes a given File into an instance of AAS environment - * - * @param file A java.io.File containing the string representation of the AAS environment - * @param charset the charset to use for deserialization - * @return an instance of AAS environment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of AAS environment using a given charset - * - * @param file a java.io.File containing the string representation of the AAS environment - * @return an instance of AAS environment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - /** * Enables usage of custom implementation to be used for deserialization instead of default implementation, e.g. * defining a custom implementation of the Submodel interface {@code class CustomSubmodel implements Submodel {}} @@ -137,180 +61,6 @@ public void useImplementation(Class aasInterface, Class impl mapper = jsonMapperFactory.create(typeResolver); } - /** - * Deserializes a given string into an instance of the given Referable - * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(String src, Class outputClass) throws DeserializationException { - return read(src, outputClass); - } - - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Class outputClass) - throws DeserializationException { - return read(src, DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param root JSON node representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(JsonNode root, Class outputClass) throws DeserializationException { - return read(root, outputClass); - } - - /** - * Deserializes a given input stream into an instance of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(InputStream src, Charset charset, Class outputClass) - throws DeserializationException { - return read(src, charset, outputClass); - } - - /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Class outputClass) - throws DeserializationException, FileNotFoundException { - return read(new FileInputStream(src), DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given file into an instance of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public T readReferable(File src, Charset charset, Class outputClass) - throws DeserializationException, FileNotFoundException { - return read(new FileInputStream(src), charset, outputClass); - } - - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ - public List readReferables(String referables, Class outputClass) - throws DeserializationException { - return readList(referables, outputClass); - } - - /** - * Deserializes a given string into an instance of a list of the given Referables - * - * @param root JSON node representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails - */ - public List readReferables(JsonNode root, Class outputClass) - throws DeserializationException { - return readList(root, outputClass); - } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) - throws DeserializationException { - return readList(src, DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) - throws DeserializationException { - return readList(src, charset, outputClass); - } - - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Class outputClass) - throws DeserializationException, FileNotFoundException { - return readList(new FileInputStream(src), DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) - throws DeserializationException, FileNotFoundException { - return readList(new FileInputStream(src), charset, outputClass); - } - /** * Generic method to deserialize a given string into instance of an AAS type * @@ -346,6 +96,19 @@ public T read(JsonNode node, Class valueType) throws DeserializationExcep } } + /** + * Generic method to deserialize a given InputStream into instance of an AAS type, using the default UTF-8 charset + * + * @param stream An InputStream containing the string representation of the AAS instance + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return an AAS instance + * @throws DeserializationException if deserialization fails + */ + public T read(InputStream stream, Class valueType) throws DeserializationException { + return read(stream, DEFAULT_CHARSET, valueType); + } + /** * Generic method to deserialize a given InputStream into instance of an AAS type, using a given charset * @@ -398,6 +161,19 @@ public List readList(JsonNode node, Class valueType) throws Deserializ } } + /** + * Deserializes a given input stream into a list of AAS instances using the default UTF-8 charset + * + * @param stream An InputStream containing the string representation of the AAS instances list + * @param valueType the class type of the AAS instance + * @param the AAS type + * @return a list of AAS instances + * @throws DeserializationException if deserialization fails + */ + public List readList(InputStream stream, Class valueType) throws DeserializationException { + return readList(stream, DEFAULT_CHARSET, valueType); + } + /** * Deserializes a given input stream into a list of AAS instances * diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index cde848c5a..619ce9796 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -19,6 +19,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; @@ -43,144 +45,11 @@ */ public class JsonSerializer { protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonSerializer() { mapper = new JsonMapperFactory().create(new SimpleAbstractTypeResolverFactory().create()); } - /** - * Serializes a given instance of AAS environment to a string - * - * @param aasEnvironment the AAS environment to serialize - * @return the string representation of the environment - * @throws SerializationException if serialization fails - */ - public String write(Environment aasEnvironment) throws SerializationException { - return write((Object)aasEnvironment); - } - - /** - * Converts a given instance of AAS environment to a JSON node - * - * @param aasEnvironment the AAS environment to serialize - * @return the JSON node representation - * @throws IllegalArgumentException - */ - public JsonNode toNode(Environment aasEnvironment) { - return toNode((Object)aasEnvironment); - } - - /** - * Serializes a given AAS environment to an output stream using given charset - * - * @param out the output stream to serialize to - * @param aasEnvironment the AAS environment to serialize - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Environment aasEnvironment) throws SerializationException { - write(out, DEFAULT_CHARSET, (Object)aasEnvironment); - } - - /** - * Serializes a given AAS environment to an output stream using given charset - * - * @param out the output stream to serialize to - * @param charset the charset to use for serialization - * @param aasEnvironment the AAS environment to serialize - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) throws SerializationException { - write(out, charset, (Object)aasEnvironment); - } - - /** - * Serializes a given instance of AAS environment to a java.io.File using DEFAULT_CHARSET - * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the AAS environment to serialize - * @throws FileNotFoundException if the fail does not exist - * @throws SerializationException if serialization fails - */ - void write(File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, SerializationException { - write(new FileOutputStream(file), charset, aasEnvironment); - } - - /** - * Serializes a given instance of Environment to a java.io.File using given charset - * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to serialize - * @throws FileNotFoundException if the fail does not exist - * @throws SerializationException if serialization fails - */ - void write(File file, Environment aasEnvironment) - throws FileNotFoundException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); - } - - /** - * Serializes a given instance of a Referable to string - * - * @param referable the referable to serialize - * @return the string representation of the referable - * @throws SerializationException if serialization fails - */ - public String write(Referable referable) throws SerializationException { - return write((Object)referable); - } - - /** - * Converts a given instance of a Referable to a JSON node. - * - * @param referable the referable to serialize - * @return the JSON node representation of the referable - */ - public JsonNode toNode(Referable referable) { - return toNode((Object)referable); - } - - /** - * Serializes a given collection of referables to string - * @param referables the collection of referables to serialize - * @return the string representation of the collection - * @throws SerializationException if serialization fails - */ - public String write(Collection referables) throws SerializationException { - return writeList(referables); - } - - /** - * Converts a collection of referables to a JSON node. - * @param referables the referables to serialize - * @return the string representation of the list of referables - */ - public JsonNode toNode(Collection referables) { - return toNode((Object)referables); - } - - /** - * Serializes a referable to string. - * @param referable the referable to serialize. - * @return the string representation. - * @throws SerializationException - */ - public String writeReferable(Referable referable) throws SerializationException { - return write(referable); - } - - /** - * Serializes a collection of referables - * @param referables the collection to serialize - * @return the string representation. - * @throws SerializationException - */ - public String writeReferables(List referables) throws SerializationException { - return write(referables); - } - /** * Generic method to serialize a given object to a string * @@ -193,7 +62,7 @@ public String write(Object aasInstance) throws SerializationException { return mapper.writeValueAsString(aasInstance); } catch (JsonProcessingException ex) { throw new SerializationException( - String.format("error serializing %s", aasInstance.getClass().getSimpleName()), ex); + String.format("error serializing %s", aasInstance.getClass().getSimpleName()), ex); } } @@ -208,6 +77,24 @@ public JsonNode toNode(Object aasInstance) { return mapper.valueToTree(aasInstance); } + /** + * Generic method to convert a collection of AAS objects to a JSON array + * + * @param aasInstances the list of AAS objects to convert + * @return the JSON array representation + * @throws IllegalArgumentException + */ + public ArrayNode toArrayNode(Collection aasInstances) { + if(aasInstances == null) { + return null; + } + ArrayNode result = JsonNodeFactory.instance.arrayNode(); + for (Object obj : aasInstances) { + result.add(toNode(obj)); + } + return result; + } + /** * Generic method to serialize a given object to an output stream using given charset * @@ -224,6 +111,22 @@ void write(OutputStream out, Charset charset, Object aasInstance) throws Seriali } } + + /** + * Generic method to serialize a given object to an output stream using UTF-8 charset + * + * @param out the output stream to serialize to + * @param aasInstance the object to serialize + * @throws SerializationException if serialization fails + */ + void write(OutputStream out, Object aasInstance) throws SerializationException { + try { + mapper.writeValue(new OutputStreamWriter(out, StandardCharsets.UTF_8), aasInstance); + } catch (IOException ex) { + throw new SerializationException("error serializing " + aasInstance.getClass().getSimpleName() , ex); + } + } + /** * Generic method to serialize a collection. * @param collection the collection to serialize diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java deleted file mode 100644 index f44ed544d..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorDeserializerTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.List; - -import static org.junit.Assert.assertEquals; - -public class JsonAssetAdministrationShellDescriptorDeserializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorDeserializerTest.class); - - - - public static AssetAdministrationShellDescriptor createAasDescriptor() { - - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .externalSubjectId(TestDataHelper.createReference( - ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) - .name("defaultSpecificAssetIdName") - .value("http://example.company/myAsset").build(); - - return new DefaultAssetAdministrationShellDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .specificAssetIds(List.of(specificAssetId)) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .globalAssetId("defaultGlobalAssetId") - .submodelDescriptors(List.of(JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor())).build(); - } - - @Test - public void testReadAasDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = - new JsonDeserializer().read(expected, AssetAdministrationShellDescriptor.class); - AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); - - assertEquals(aasExpected, assetAdministrationShellDescriptor); - } - - - @Test - public void testReadAasDescriptorsList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; - List assetAdministrationShellDescriptors = - new JsonDeserializer().readList(expected, AssetAdministrationShellDescriptor.class); - AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); - - assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java deleted file mode 100644 index 48fd5c528..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonAssetAdministrationShellDescriptorSerializerTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.json.JSONException; -import org.junit.Assert; -import org.junit.Test; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.Set; - -import static org.junit.Assert.assertTrue; - -public class JsonAssetAdministrationShellDescriptorSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonAssetAdministrationShellDescriptorSerializerTest.class); - - @Test - public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - Assert.assertTrue(fileExpected.exists()); - validateAndCompare(fileExpected, JsonAssetAdministrationShellDescriptorDeserializerTest.createAasDescriptor()); - } - - private void validateAndCompare(File expectedFile, AssetAdministrationShellDescriptor descriptor) throws IOException, SerializationException, JSONException { - String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().write(descriptor); - logger.debug(actual); - Set errors = new JsonSchemaValidator().validateSchema(actual); - assertTrue(errors.isEmpty()); - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } -} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 9dc6a5a52..f2e4f046e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -16,26 +16,59 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; + + +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import static org.junit.Assert.assertEquals; @@ -45,7 +78,7 @@ public class JsonDeserializerTest { @Test public void testReadEnvironmentFromStream() throws Exception { - Environment env = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + Environment env = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); assertNotNull(env); } @@ -53,7 +86,7 @@ public void testReadEnvironmentFromStream() throws Exception { public void testReadEnvironmentFromFile() throws Exception { File file = Paths.get("src", "test", "resources", "Example-Full.json").toFile(); assertTrue(file.exists()); - Environment env = new JsonDeserializer().read(file); + Environment env = new JsonDeserializer().read(new FileInputStream(file), Environment.class); assertNotNull(env); } @@ -62,20 +95,20 @@ public void testReadReferable() throws Exception { Path path = Paths.get("src", "test", "resources", "Submodel.json"); assertTrue(path.toFile().exists()); String jsonSubmodel = Files.readString(path); - Submodel submodel = new JsonDeserializer().readReferable(jsonSubmodel, Submodel.class); + Submodel submodel = new JsonDeserializer().read(jsonSubmodel, Submodel.class); assertNotNull(submodel); } @Test public void testReadReferableFromStream() throws Exception { - Submodel submodel = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); + Submodel submodel = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), Submodel.class); assertNotNull(submodel); } @Test public void testReadReferableFromNode() throws Exception { JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL.fileContentStream()); - Submodel submodel = new JsonDeserializer().readReferable(node, Submodel.class); + Submodel submodel = new JsonDeserializer().read(node, Submodel.class); assertNotNull(submodel); } @@ -83,7 +116,7 @@ public void testReadReferableFromNode() throws Exception { public void testReadReferableFromFile() throws Exception { File file = Paths.get("src", "test", "resources", "Submodel.json").toFile(); assertTrue(file.exists()); - Submodel submodel = new JsonDeserializer().readReferable(file, Submodel.class); + Submodel submodel = new JsonDeserializer().read(new FileInputStream(file), Submodel.class); assertNotNull(submodel); } @@ -92,7 +125,7 @@ public void testReadReferables() throws Exception { Path path = Paths.get("src", "test", "resources", "Submodel-List.json"); assertTrue(path.toFile().exists()); String jsonSubmodels = Files.readString(path); - List submodels = new JsonDeserializer().readReferables(jsonSubmodels, Submodel.class); + List submodels = new JsonDeserializer().readList(jsonSubmodels, Submodel.class); assertNotNull(submodels); assertEquals(2, submodels.size()); assertNotNull(submodels.get(0)); @@ -102,7 +135,7 @@ public void testReadReferables() throws Exception { @Test public void testReadReferablesFromNode() throws Exception { JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL_LIST_OF.fileContentStream()); - List submodels = new JsonDeserializer().readReferables(node, Submodel.class); + List submodels = new JsonDeserializer().readList(node, Submodel.class); assertNotNull(submodels); assertEquals(2, submodels.size()); assertNotNull(submodels.get(0)); @@ -111,7 +144,7 @@ public void testReadReferablesFromNode() throws Exception { @Test public void testReadReferablesFromStream() throws Exception { - List submodels = new JsonDeserializer().readReferables( + List submodels = new JsonDeserializer().readList( Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); assertNotNull(submodels); assertEquals(2, submodels.size()); @@ -123,7 +156,7 @@ public void testReadReferablesFromStream() throws Exception { public void testReadReferablesFromFile() throws Exception { File file = Paths.get("src", "test", "resources", "Submodel-List.json").toFile(); assertTrue(file.exists()); - List submodels = new JsonDeserializer().readReferables(file, Submodel.class); + List submodels = new JsonDeserializer().readList(new FileInputStream(file), Submodel.class); assertNotNull(submodels); assertEquals(2, submodels.size()); assertNotNull(submodels.get(0)); @@ -135,14 +168,14 @@ public void testReadReferablesFromFile() throws Exception { @Test public void testSimpleExample() throws Exception { Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @Test public void testFullExample() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); + Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @@ -150,7 +183,7 @@ public void testFullExample() throws Exception { public void testFullExampleFromNode() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); JsonNode node = new ObjectMapper().readTree(Examples.EXAMPLE_FULL.fileContentStream()); - Environment actual = new JsonDeserializer().read(node); + Environment actual = new JsonDeserializer().read(node, Environment.class); Assert.assertEquals(expected, actual); } @@ -158,17 +191,269 @@ public void testFullExampleFromNode() throws Exception { public void testCustomImplementationClass() throws Exception { String json = new JsonSerializer().write(AASSimple.createEnvironment()); JsonDeserializer deserializer = new JsonDeserializer(); - Environment environment = deserializer.read(json); + Environment environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); deserializer.useImplementation(Property.class, CustomProperty.class); - environment = deserializer.read(json); + environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, CustomSubmodel.class, CustomProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel2.class); - environment = deserializer.read(json); + environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, CustomSubmodel2.class, CustomProperty.class); } + + @Test + public void testReadAAS() throws DeserializationException { + AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); + AssetAdministrationShell actual = new JsonDeserializer().read(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); + } + + @Test + public void testReadAASs() throws DeserializationException { + List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readList(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelUsingUtf8Charset() throws DeserializationException { + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { + Submodel expected = Examples.SUBMODEL.getModel(); + File file = new File("src/test/resources/Submodel.json"); + assertTrue(file.exists()); + Submodel actual = new JsonDeserializer().read(new FileInputStream(file), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelsFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + File file = new File("src/test/resources/Submodel-List.json"); + assertTrue(file.exists()); + List actual = new JsonDeserializer().readList(new FileInputStream(file), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelsFromStreamUsingUtf8Charset() throws DeserializationException { + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readList( + Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodel() throws DeserializationException { + Submodel expected = Examples.SUBMODEL.getModel(); + Submodel actual = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodels() throws DeserializationException { + List expected = Examples.SUBMODEL_LIST_OF.getModel(); + List actual = new JsonDeserializer().readList(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelElement() throws DeserializationException { + SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); + SubmodelElement actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelElements() throws DeserializationException { + List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); + List actual = new JsonDeserializer().readList( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelElementList() throws DeserializationException { + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); + SubmodelElementList actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + assertEquals(expected, actual); + } + + @Test + public void testReadSubmodelElementCollection() throws DeserializationException { + SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); + SubmodelElementCollection actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + assertEquals(expected, actual); + } + + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = new JsonDeserializer().readList("[]", Referable.class); + assertEquals(emptyList, deserialized); + } + + @Test + @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") + public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { + ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; + Object expected = exampleData.getModel(); + try (InputStream fileContent = exampleData.fileContentStream()) { + Object actual = new JsonDeserializer().read(fileContent, (Class) exampleData.getModel().getClass()); + Assert.assertEquals(expected, actual); + } + } + + + @Test + public void testPropertyFromNode() throws Exception { + Property expected = new DefaultProperty.Builder() + .idShort("exampleId") + .build(); + ObjectNode input = JsonNodeFactory.instance.objectNode(); + input.put("idShort", "exampleId"); + input.put("modelType", "Property"); + Property actual = new JsonDeserializer().read(input, Property.class); + assertEquals(expected, actual); + } + + @Test + public void testExtensionMinimal() throws Exception { + Environment expected = Examples.EXTENSION_MINIMAL.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MINIMAL.fileContentStream(), Environment.class); + assertEquals(expected, actual); + } + + @Test + public void testExtensionMaximal() throws Exception { + Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); + Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MAXIMAL.fileContentStream(), Environment.class); + assertEquals(expected, actual); + } + + static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .externalSubjectId(TestDataHelper.createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .specificAssetIds(List.of(specificAssetId)) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .globalAssetId("defaultGlobalAssetId") + .submodelDescriptors(List.of(getDefaultSubmodelDescriptor())).build(); + } + + @Test + public void testReadAasDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = + new JsonDeserializer().read(expected, AssetAdministrationShellDescriptor.class); + AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); + + assertEquals(aasExpected, assetAdministrationShellDescriptor); + } + + @Test + public void testReadAasDescriptorsList() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); + String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; + List assetAdministrationShellDescriptors = + new JsonDeserializer().readList(expected, AssetAdministrationShellDescriptor.class); + AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); + + assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); + } + + @Test + public void testDeserializeDuration() throws DeserializationException, DatatypeConfigurationException, SerializationException { + Duration duration = DatatypeFactory.newInstance().newDurationDayTime("P0DT0H3M0S"); // three minutes + JsonDeserializer deserializer = new JsonDeserializer(); + String operationRequestString = new JsonSerializer().write(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.OPERATION_REQUEST); + OperationRequest operationRequest = deserializer.read(operationRequestString, OperationRequest.class); + assertEquals( operationRequest.getClientTimeoutDuration() , duration); + } + + @Test + public void testDeserializeReference() throws DeserializationException, SerializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + String jsonReference = new JsonSerializer().write(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); + Reference reference = deserializer.read(jsonReference, Reference.class); + assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); + } + + @Test + public void testDeserializeReferenceList() throws DeserializationException, SerializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + String jsonReferenceList = new JsonSerializer().writeList(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); + List referenceList = deserializer.readList(jsonReferenceList, Reference.class); + assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); + } + + @Test + public void testDeserializeSpecificAssetId() throws DeserializationException, SerializationException { + SpecificAssetId expected = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + + String specificAssetIdString = new JsonSerializer().write(expected); + JsonDeserializer deserializer = new JsonDeserializer(); + assertEquals(expected, deserializer.read(specificAssetIdString, SpecificAssetId.class)); + } + + @Test + public void testDeserializeSpecificAssetIdList() throws DeserializationException, SerializationException { + JsonSerializer serializer = new JsonSerializer(); + + SpecificAssetId expected = new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + + String specificAssetId_list_string = serializer.writeList(List.of(expected)); + JsonDeserializer deserializer = new JsonDeserializer(); + List specificAssetIdList = deserializer.readList( + specificAssetId_list_string, SpecificAssetId.class); + assertEquals(expected, specificAssetIdList.get(0)); + } + + @Test + public void testReadSubmodelDescriptor() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); + String expected = Files.readString(fileExpected.toPath()); + SubmodelDescriptor submodelDescriptor = new JsonDeserializer().read(expected, SubmodelDescriptor.class); + SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + + assertEquals(submodelDescriptorExpected, submodelDescriptor); + } + + @Test + public void testReadSubmodelDescriptors() throws IOException, DeserializationException { + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); + String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; + List submodelDescriptors = + new JsonDeserializer().readList(expected, SubmodelDescriptor.class); + SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); + } + private void checkImplementationClasses(Environment environment, Class submodelImpl, Class propertyImpl) { environment.getSubmodels().forEach(submodel -> { @@ -178,4 +463,16 @@ private void checkImplementationClasses(Environment environment, .forEach(element -> assertEquals(element.getClass(), propertyImpl)); }); } + + static SubmodelDescriptor getDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .build(); + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java deleted file mode 100644 index 86b4de687..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDurationDeserializerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; - -import static org.junit.Assert.assertEquals; - -public class JsonDurationDeserializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonDurationDeserializerTest.class); - - String operationRequestString; - - @Before - public void prepare() throws SerializationException, JsonProcessingException { - - operationRequestString = new ObjectMapper().writeValueAsString(Examples.OPERATION_REQUEST); - - } - - - @Test - public void testDeserializeDuration() throws DeserializationException, DatatypeConfigurationException { - - Duration duration = DatatypeFactory.newInstance().newDurationDayTime("P0DT0H3M0S"); // three minutes - - JsonDeserializer deserializer = new JsonDeserializer(); - - OperationRequest operationRequest = deserializer.read(operationRequestString, OperationRequest.class); - - assertEquals( operationRequest.getClientTimeoutDuration() , duration); - } - - -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java deleted file mode 100644 index 8a0cd6aec..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - - -public class JsonReferableDeserializerTest { - - @Test - public void testReadAAS() throws DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); - } - - @Test - public void testReadAASs() throws DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelUsingUtf8Charset() throws DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { - Submodel expected = Examples.SUBMODEL.getModel(); - File file = new File("src/test/resources/Submodel.json"); - assertTrue(file.exists()); - Submodel actual = new JsonDeserializer().readReferable(file, StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - - @Test - public void testReadSubmodelsFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - File file = new File("src/test/resources/Submodel-List.json"); - assertTrue(file.exists()); - List actual = new JsonDeserializer().readReferables(file, StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelsFromStreamUsingUtf8Charset() throws DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodel() throws DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodels() throws DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElement() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElements() throws DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElementList() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElementCollection() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); - } - - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } - - @Test - @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") - public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { - ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; - Object expected = exampleData.getModel(); - try (InputStream fileContent = exampleData.fileContentStream()) { - Object actual = new JsonDeserializer().readReferable(fileContent, (Class) exampleData.getModel().getClass()); - Assert.assertEquals(expected, actual); - } - } - - - @Test - public void testPropertyFromNode() throws Exception { - Property expected = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode input = JsonNodeFactory.instance.objectNode(); - input.put("idShort", "exampleId"); - input.put("modelType", "Property"); - Property actual = new JsonDeserializer().readReferable(input, Property.class); - assertEquals(expected, actual); - } - - @Test - public void testExtensionMinimal() throws Exception { - Environment expected = Examples.EXTENSION_MINIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MINIMAL.fileContentStream()); - assertEquals(expected, actual); - } - - @Test - public void testExtensionMaximal() throws Exception { - Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MAXIMAL.fileContentStream()); - assertEquals(expected, actual); - } -} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java deleted file mode 100644 index 4ddf10b34..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.json.JSONException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -public class JsonReferableSerializerTest { - - @Test - public void testSerializeAAS() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL); - } - - @Test - public void testSerializeAASWithAssetInformation() throws SerializationException, JSONException, IOException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); - } - - @Test - public void testSerializeAASs() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); - } - - @Test - @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { - compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); - } - - @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL); - } - - @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); - } - - @Test - public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT); - } - - @Test - public void testSerializeSubmodelWithExtensions() throws DeserializationException, SerializationException, JsonProcessingException { - Submodel submodel = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - submodel.getExtensions().add(new DefaultExtension.Builder() - .name("myExtension").value("my extension value").valueType(DataTypeDefXsd.STRING) - .build()); - JsonNode jsonNode = new ObjectMapper().readTree(new JsonSerializer().writeReferable(submodel)); - Assert.assertTrue(jsonNode.has("extensions")); - } - - @Test - public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); - } - - @Test - public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_COLLECTION); - } - - @Test - public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST); - } - - @Test - public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); - } - - @Test - public void testSerializePropertyToNode() throws IOException, SerializationException, JSONException { - Property property = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode expected = JsonNodeFactory.instance.objectNode(); - expected.put("idShort", "exampleId"); - expected.put("modelType", "Property"); - JsonNode actual = new JsonSerializer().toNode(property); - Assert.assertEquals(expected, actual); - } - - @Test - public void testSerializeListOfReferablesToNode() throws IOException, SerializationException, JSONException { - List referables = new ArrayList<>(); - referables.add(new DefaultProperty.Builder() - .idShort("exampleId") - .build()); - JsonNode node = new JsonSerializer().toNode(referables); - Assert.assertNotNull(node); - Assert.assertTrue(node.isArray()); - } - - @Test - public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { - compare(Examples.EXTENSION_MINIMAL); - } - @Test - public void testSerializeExtensionMaximal() throws SerializationException, JSONException, IOException { - compare(Examples.EXTENSION_MAXIMAL); - } - - @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = null; - if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Environment) exampleData.getModel()); - } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().writeReferable((Referable) exampleData.getModel()); - } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) - && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().writeReferables((List) exampleData.getModel()); - } - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } - -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java deleted file mode 100644 index f0b26f06f..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceDeserializerTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; - -import org.junit.Before; -import org.junit.Test; - -import java.util.List; - -import static org.junit.Assert.assertTrue; - -public class JsonReferenceDeserializerTest { - private String reference_string; - private String reference_list_string; - - - @Before - public void prepare() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - reference_string = serializer.write(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); - reference_list_string = serializer.writeList(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); - } - - @Test - public void testDeserializeReference() throws DeserializationException { - JsonDeserializer deserializer = new JsonDeserializer(); - Reference reference = deserializer.read(reference_string, Reference.class); - assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); - } - - @Test - public void testDeserializeReferenceList() throws DeserializationException { - JsonDeserializer deserializer = new JsonDeserializer(); - List referenceList = deserializer.readList(reference_list_string, Reference.class); - assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); - } -} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java deleted file mode 100644 index 92d093257..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferenceSerializerTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -import static org.junit.Assert.assertTrue; - -public class JsonReferenceSerializerTest { - - private static final Logger logger = LoggerFactory.getLogger(JsonReferenceSerializerTest.class); - - @Test - public void testSerializeReference() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); - String serializedReference = serializer.write(reference); - assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); - } - - @Test - public void testSerializeReferenceList() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); - String serializedReferenceArray = serializer.write(referenceList); - assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 5f71930eb..122186f86 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -18,18 +18,34 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; + import org.json.JSONException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -39,31 +55,41 @@ import org.slf4j.LoggerFactory; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializerTest.getDefaultSubmodelDescriptor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class JsonSerializerTest { private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); + private static JsonSerializer serializerToTest; + + @BeforeClass + public static void initialize() { + serializerToTest = new JsonSerializer(); + } @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Test public void testSerializeNull() throws SerializationException { - Environment env = null; - assertEquals("null", new JsonSerializer().write(env)); + assertEquals("null", serializerToTest.write(null)); } @Test public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.createEnvironment()); + serializerToTest.write(new FileOutputStream(file), AASSimple.createEnvironment()); assertTrue(file.exists()); } @@ -85,15 +111,14 @@ public void testSerializeFullExample() throws SerializationException, JSONExcept @Test public void testSerializeFullExampleToNode() throws JSONException, IOException { String expected = Examples.EXAMPLE_FULL.fileContent(); - JsonNode node = new JsonSerializer().toNode(Examples.EXAMPLE_FULL.getModel()); - String actual = new ObjectMapper().writeValueAsString(node); - validateAndCompare(expected, actual); + JsonNode node = serializerToTest.toNode(Examples.EXAMPLE_FULL.getModel()); + validateAndCompare(expected, node.toPrettyString()); } @Test public void testSerializeEmptyReferableList() throws SerializationException, JSONException { List emptyList = Collections.emptyList(); - String actual = new JsonSerializer().write(emptyList); + String actual = serializerToTest.write(emptyList); JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); } @@ -105,24 +130,200 @@ public void testSerializeEmptyReferableList() throws SerializationException, JSO */ @Test public void testSerializeCustomDataSpecification() throws SerializationException, DeserializationException { - JsonSerializer serializer = new JsonSerializer(); JsonDeserializer deserializer = new JsonDeserializer(); // This is the only way to make the serialization to work. Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); subtypes.add(DefaultDummyDataSpecification.class); - Environment origin = org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC ; + Environment origin = org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC; - String jsonString = serializer.write(origin); + String jsonString = serializerToTest.write(origin); assertNotNull(jsonString); - Environment copy = deserializer.read(jsonString); + Environment copy = deserializer.read(jsonString, Environment.class); assertNotNull(copy); assertTrue(origin.equals(copy)); } + @Test + public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); + Assert.assertTrue(fileExpected.exists()); + validateAndCompare( + Files.readString(fileExpected.toPath()), + serializerToTest.write(JsonDeserializerTest.createAasDescriptor())); + } + + @Test + public void testSerializeAAS() throws IOException, SerializationException, JSONException { + compare(Examples.ASSET_ADMINISTRATION_SHELL); + } + + @Test + public void testSerializeAASWithAssetInformation() throws SerializationException, JSONException, IOException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); + } + + @Test + public void testSerializeAASs() throws IOException, SerializationException, JSONException { + compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + } + + @Test + @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") + public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { + compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); + } + + @Test + public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL); + } + + @Test + public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + } + + @Test + public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT); + } + + @Test + public void testSerializeSubmodelWithExtensions() throws DeserializationException, SerializationException, JsonProcessingException { + List extensions = List.of( + new DefaultExtension.Builder() + .name("myExtension").value("my extension value").valueType(DataTypeDefXsd.STRING) + .build()); + JsonNode jsonNode = serializerToTest.toArrayNode(extensions); + Assert.assertTrue(jsonNode.isArray()); + List actual = new JsonDeserializer().readList(jsonNode, Extension.class); + assertEquals(extensions, actual); + } + + @Test + public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + } + + @Test + public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_COLLECTION); + } + + @Test + public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { + compare(Examples.SUBMODEL_ELEMENT_LIST); + } + + @Test + public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { + compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); + } + + @Test + public void testSerializePropertyToNode() throws JSONException { + Property property = new DefaultProperty.Builder() + .idShort("exampleId") + .build(); + ObjectNode expected = JsonNodeFactory.instance.objectNode(); + expected.put("idShort", "exampleId"); + expected.put("modelType", "Property"); + JsonNode actual = serializerToTest.toNode(property); + validateAndCompare(expected.toPrettyString(), actual.toPrettyString()); + } + + @Test + public void testSerializeListOfReferablesToNode() throws DeserializationException { + List referables = List.of( + new DefaultProperty.Builder() + .idShort("exampleId") + .build()); + JsonNode node = serializerToTest.toArrayNode(referables); + Assert.assertNotNull(node); + Assert.assertTrue(node.isArray()); + List actual = new JsonDeserializer().readList(node, Referable.class); + assertEquals(referables, actual); + } + + @Test + public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { + compare(Examples.EXTENSION_MINIMAL); + } + + @Test + public void testSerializeExtensionMaximal() throws SerializationException, JSONException, IOException { + compare(Examples.EXTENSION_MAXIMAL); + } + + @Test + public void testSerializeReference() throws SerializationException, DeserializationException { + Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); + String serializedReference = serializerToTest.write(reference); + assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); + assertEquals(reference, new JsonDeserializer().read(serializedReference, Reference.class)); + } + + @Test + public void testSerializeReferenceList() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); + String serializedReferenceArray = serializer.write(referenceList); + assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); + } + + @Test + public void testSerializeSpecificAssetId() throws SerializationException { + JsonSerializer serializer = new JsonSerializer(); + SpecificAssetId specificAssetId = TestDataHelper.createSpecificAssetId(); + String specificAssetId_string = serializer.write(specificAssetId); + assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); + } + + + @Test + public void testSerializeSpecificAssetIdList() throws SerializationException { + SpecificAssetId specificAssetId = TestDataHelper.createSpecificAssetId(); + List specificAssetIds = new ArrayList<>() {{ + add(specificAssetId); + add(specificAssetId); + }}; + + JsonSerializer serializer = new JsonSerializer(); + String specificAssetId_list_string = serializer.writeList(specificAssetIds); + assertTrue(specificAssetId_list_string.startsWith("[")); + assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); + } + + @Test + public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { + File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); + validateAndCompare(fileExpected, getDefaultSubmodelDescriptor()); + } + + private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { + String expected = Files.readString(expectedFile.toPath()); + String actual = new JsonSerializer().write(descriptor); + validateAndCompare(expected, actual); + } + + + @SuppressWarnings("unchecked") + private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { + String expected = exampleData.fileContent(); + String actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = new JsonSerializer().writeList((Collection) exampleData.getModel()); + } else { + actual = new JsonSerializer().write(exampleData.getModel()); + } + //validateAndCompare(expected, actual); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java deleted file mode 100644 index 844fda8e9..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdDeserializerTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertTrue; - -public class JsonSpecificAssetIdDeserializerTest { - private String specificAssetId_string; - private String specificAssetId_list_string; - - - @Before - public void prepare() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() - .name("testSpecificAssetId") - .value("testValue") - .build(); - List specificAssetIds = new ArrayList<>() {{ - add(specificAssetId); - add(specificAssetId); - }}; - - specificAssetId_string = serializer.write(specificAssetId); - specificAssetId_list_string = serializer.writeList(specificAssetIds); - } - - - @Test - public void testDeserializeReference() throws DeserializationException { - JsonDeserializer deserializer = new JsonDeserializer(); - SpecificAssetId specificAssetId = deserializer.read(specificAssetId_string, SpecificAssetId.class); - assertTrue(!specificAssetId.getValue().isEmpty()); - } - - - @Test - public void testDeserializeReferenceList() throws DeserializationException { - JsonDeserializer deserializer = new JsonDeserializer(); - List specificAssetIdList = deserializer.readList( - specificAssetId_list_string, SpecificAssetId.class); - assertTrue(specificAssetIdList.get(0).getValue().equalsIgnoreCase("testvalue")); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java deleted file mode 100644 index 7460a4bb0..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSpecificAssetIdSerializerTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertTrue; - -public class JsonSpecificAssetIdSerializerTest { - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() - .name("testSpecificAssetId") - .value("testValue") - .build(); - - - @Test - public void testSerializeSpecificAssetId() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); - String specificAssetId_string = serializer.write(specificAssetId); - assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); - } - - - @Test - public void testSerializeSpecificAssetIdList() throws SerializationException { - List specificAssetIds = new ArrayList<>() {{ - add(specificAssetId); - add(specificAssetId); - }}; - - JsonSerializer serializer = new JsonSerializer(); - String specificAssetId_list_string = serializer.writeList(specificAssetIds); - assertTrue(specificAssetId_list_string.startsWith("[")); - assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); - } -} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java deleted file mode 100644 index 6a0e75c8e..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorDeserializerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.List; - -import static org.junit.Assert.assertEquals; - -public class JsonSubmodelDescriptorDeserializerTest { - public static SubmodelDescriptor getDefaultSubmodelDescriptor () { - return new DefaultSubmodelDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .build(); - } - - @Test - public void testReadSubmodelDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelDescriptor submodelDescriptor = new JsonDeserializer().read(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); - - assertEquals(submodelDescriptorExpected, submodelDescriptor); - } - - @Test - public void testReadSubmodelDescriptors() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; - List submodelDescriptors = - new JsonDeserializer().readList(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); - assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); - } -} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java deleted file mode 100644 index 44318976b..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSubmodelDescriptorSerializerTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.json.JSONException; -import org.junit.Test; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.util.Set; - -import static org.junit.Assert.assertTrue; - -public class JsonSubmodelDescriptorSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonSubmodelDescriptorSerializerTest.class); - - @Test - public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - validateAndCompare(fileExpected, JsonSubmodelDescriptorDeserializerTest.getDefaultSubmodelDescriptor()); - } - - private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { - String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().write(descriptor); - logger.info(actual); - Set errors = new JsonSchemaValidator().validateSchema(actual); - assertTrue(errors.isEmpty()); - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index b49a54e35..2db1309ab 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -12,6 +12,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; @@ -23,6 +24,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import java.util.List; @@ -97,4 +99,11 @@ public static DefaultProtocolInformation.Builder createProtocolInformationBuilde .value("NONE") .build()); } + + public static SpecificAssetId createSpecificAssetId() { + return new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + } } From f7e305255fa35bd53d43da5b6ca3ecdf3c217ff5 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 14:24:01 +0100 Subject: [PATCH 59/91] Update JsonDeserializerTest.java --- .../dataformat/json/JsonDeserializerTest.java | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index f2e4f046e..5407a56cf 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -47,10 +47,10 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; - - import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; + import org.junit.Assert; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -62,12 +62,10 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -76,48 +74,43 @@ import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { - @Test - public void testReadEnvironmentFromStream() throws Exception { - Environment env = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); - assertNotNull(env); + + private static JsonDeserializer deserializerToTest; + + @BeforeClass + public static void initialize() { + deserializerToTest = new JsonDeserializer(); } @Test - public void testReadEnvironmentFromFile() throws Exception { - File file = Paths.get("src", "test", "resources", "Example-Full.json").toFile(); - assertTrue(file.exists()); - Environment env = new JsonDeserializer().read(new FileInputStream(file), Environment.class); - assertNotNull(env); + public void testReadEnvironmentFromStream() throws DeserializationException { + Environment env = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); + assertEquals(Examples.EXAMPLE_FULL.getModel(), env); } @Test - public void testReadReferable() throws Exception { - Path path = Paths.get("src", "test", "resources", "Submodel.json"); - assertTrue(path.toFile().exists()); - String jsonSubmodel = Files.readString(path); - Submodel submodel = new JsonDeserializer().read(jsonSubmodel, Submodel.class); - assertNotNull(submodel); + public void testReadReferable() throws IOException, DeserializationException { + Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContent(), Submodel.class); + assertEquals(Examples.SUBMODEL.getModel(), submodel); } @Test - public void testReadReferableFromStream() throws Exception { - Submodel submodel = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertNotNull(submodel); + public void testReadReferableFromStream() throws DeserializationException { + Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); + assertEquals(Examples.SUBMODEL.getModel(), submodel); } @Test public void testReadReferableFromNode() throws Exception { JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL.fileContentStream()); - Submodel submodel = new JsonDeserializer().read(node, Submodel.class); - assertNotNull(submodel); + Submodel submodel = deserializerToTest.read(node, Submodel.class); + assertEquals(Examples.SUBMODEL.getModel(), submodel); } @Test - public void testReadReferableFromFile() throws Exception { - File file = Paths.get("src", "test", "resources", "Submodel.json").toFile(); - assertTrue(file.exists()); - Submodel submodel = new JsonDeserializer().read(new FileInputStream(file), Submodel.class); - assertNotNull(submodel); + public void testReadReferableFromStreamUsingCharset() throws Exception { + Submodel submodel = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(Examples.SUBMODEL.getModel(), submodel); } @Test @@ -125,7 +118,7 @@ public void testReadReferables() throws Exception { Path path = Paths.get("src", "test", "resources", "Submodel-List.json"); assertTrue(path.toFile().exists()); String jsonSubmodels = Files.readString(path); - List submodels = new JsonDeserializer().readList(jsonSubmodels, Submodel.class); + List submodels = new JsonDeserializer().readList( jsonSubmodels, Submodel.class); assertNotNull(submodels); assertEquals(2, submodels.size()); assertNotNull(submodels.get(0)); From 517fd75a0d0d4271269658e7b628133365675209 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 15:24:32 +0100 Subject: [PATCH 60/91] Improve the serialization tests --- .../dataformat/json/JsonDeserializerTest.java | 161 +++++------------- .../dataformat/json/JsonSerializerTest.java | 9 +- .../v3/dataformat/json/TestDataHelper.java | 37 ++++ 3 files changed, 84 insertions(+), 123 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 5407a56cf..0d7fc64cb 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -25,13 +25,11 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; @@ -43,11 +41,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.junit.Assert; import org.junit.BeforeClass; @@ -58,19 +54,15 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Collections; import java.util.List; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { @@ -109,66 +101,48 @@ public void testReadReferableFromNode() throws Exception { @Test public void testReadReferableFromStreamUsingCharset() throws Exception { - Submodel submodel = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); assertEquals(Examples.SUBMODEL.getModel(), submodel); } @Test public void testReadReferables() throws Exception { - Path path = Paths.get("src", "test", "resources", "Submodel-List.json"); - assertTrue(path.toFile().exists()); - String jsonSubmodels = Files.readString(path); - List submodels = new JsonDeserializer().readList( jsonSubmodels, Submodel.class); - assertNotNull(submodels); - assertEquals(2, submodels.size()); - assertNotNull(submodels.get(0)); - assertNotNull(submodels.get(1)); + List submodels = deserializerToTest.readList(Examples.SUBMODEL_LIST_OF.fileContent(), Submodel.class); + assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); } @Test public void testReadReferablesFromNode() throws Exception { JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL_LIST_OF.fileContentStream()); - List submodels = new JsonDeserializer().readList(node, Submodel.class); - assertNotNull(submodels); - assertEquals(2, submodels.size()); - assertNotNull(submodels.get(0)); - assertNotNull(submodels.get(1)); + List submodels = deserializerToTest.readList(node, Submodel.class); + assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); } @Test public void testReadReferablesFromStream() throws Exception { - List submodels = new JsonDeserializer().readList( + List submodels = deserializerToTest.readList( Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertNotNull(submodels); - assertEquals(2, submodels.size()); - assertNotNull(submodels.get(0)); - assertNotNull(submodels.get(1)); + assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); } @Test - public void testReadReferablesFromFile() throws Exception { - File file = Paths.get("src", "test", "resources", "Submodel-List.json").toFile(); - assertTrue(file.exists()); - List submodels = new JsonDeserializer().readList(new FileInputStream(file), Submodel.class); - assertNotNull(submodels); - assertEquals(2, submodels.size()); - assertNotNull(submodels.get(0)); - assertNotNull(submodels.get(1)); + public void testReadReferablesFromStreamUsingUtf8Charset() throws Exception { + List submodels = deserializerToTest.readList( + Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); } - - @Test public void testSimpleExample() throws Exception { Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream(), Environment.class); + Environment actual = deserializerToTest.read(Examples.EXAMPLE_SIMPLE.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @Test public void testFullExample() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); + Environment actual = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @@ -176,7 +150,7 @@ public void testFullExample() throws Exception { public void testFullExampleFromNode() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); JsonNode node = new ObjectMapper().readTree(Examples.EXAMPLE_FULL.fileContentStream()); - Environment actual = new JsonDeserializer().read(node, Environment.class); + Environment actual = deserializerToTest.read(node, Environment.class); Assert.assertEquals(expected, actual); } @@ -195,113 +169,93 @@ public void testCustomImplementationClass() throws Exception { checkImplementationClasses(environment, CustomSubmodel2.class, CustomProperty.class); } - @Test public void testReadAAS() throws DeserializationException { AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().read(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + AssetAdministrationShell actual = deserializerToTest.read(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); } @Test public void testReadAASs() throws DeserializationException { List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readList(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); + List actual = deserializerToTest.readList(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); } @Test public void testReadSubmodelUsingUtf8Charset() throws DeserializationException { Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { - Submodel expected = Examples.SUBMODEL.getModel(); - File file = new File("src/test/resources/Submodel.json"); - assertTrue(file.exists()); - Submodel actual = new JsonDeserializer().read(new FileInputStream(file), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelsFromFileUsingUtf8Charset() throws DeserializationException, FileNotFoundException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - File file = new File("src/test/resources/Submodel-List.json"); - assertTrue(file.exists()); - List actual = new JsonDeserializer().readList(new FileInputStream(file), StandardCharsets.UTF_8, Submodel.class); + Submodel actual = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); assertEquals(expected, actual); } @Test public void testReadSubmodelsFromStreamUsingUtf8Charset() throws DeserializationException { List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readList( - Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); + List actual = deserializerToTest.readList( + Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); assertEquals(expected, actual); } @Test public void testReadSubmodel() throws DeserializationException { Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().read(Examples.SUBMODEL.fileContentStream(), Submodel.class); + Submodel actual = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); assertEquals(expected, actual); } @Test public void testReadSubmodels() throws DeserializationException { List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readList(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); + List actual = deserializerToTest.readList(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); assertEquals(expected, actual); } @Test public void testReadSubmodelElement() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); + SubmodelElement actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); assertEquals(expected, actual); } @Test public void testReadSubmodelElements() throws DeserializationException { List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readList( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); + List actual = deserializerToTest.readList( + Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); assertEquals(expected, actual); } @Test public void testReadSubmodelElementList() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); + SubmodelElementList actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); assertEquals(expected, actual); } @Test public void testReadSubmodelElementCollection() throws DeserializationException { SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().read(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); + SubmodelElementCollection actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); assertEquals(expected, actual); } @Test public void testReadEmptyReferableList() throws DeserializationException { List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readList("[]", Referable.class); + List deserialized = deserializerToTest.readList("[]", Referable.class); assertEquals(emptyList, deserialized); } @Test @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { - ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; - Object expected = exampleData.getModel(); - try (InputStream fileContent = exampleData.fileContentStream()) { - Object actual = new JsonDeserializer().read(fileContent, (Class) exampleData.getModel().getClass()); - Assert.assertEquals(expected, actual); - } + ConceptDescription expected = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.getModel(); + ConceptDescription actual = deserializerToTest.read( + Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.fileContentStream(), + ConceptDescription.class); + assertEquals(expected, actual); } @@ -310,47 +264,28 @@ public void testPropertyFromNode() throws Exception { Property expected = new DefaultProperty.Builder() .idShort("exampleId") .build(); - ObjectNode input = JsonNodeFactory.instance.objectNode(); - input.put("idShort", "exampleId"); - input.put("modelType", "Property"); - Property actual = new JsonDeserializer().read(input, Property.class); + ObjectNode node = JsonNodeFactory.instance.objectNode(); + node.put("idShort", "exampleId"); + node.put("modelType", "Property"); + Property actual = deserializerToTest.read(node, Property.class); assertEquals(expected, actual); } @Test public void testExtensionMinimal() throws Exception { Environment expected = Examples.EXTENSION_MINIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MINIMAL.fileContentStream(), Environment.class); + Environment actual = deserializerToTest.read(Examples.EXTENSION_MINIMAL.fileContentStream(), Environment.class); assertEquals(expected, actual); } @Test public void testExtensionMaximal() throws Exception { Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MAXIMAL.fileContentStream(), Environment.class); + Environment actual = deserializerToTest.read(Examples.EXTENSION_MAXIMAL.fileContentStream(), Environment.class); assertEquals(expected, actual); } - static AssetAdministrationShellDescriptor createAasDescriptor() { - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .externalSubjectId(TestDataHelper.createReference( - ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) - .name("defaultSpecificAssetIdName") - .value("http://example.company/myAsset").build(); - - return new DefaultAssetAdministrationShellDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .specificAssetIds(List.of(specificAssetId)) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .globalAssetId("defaultGlobalAssetId") - .submodelDescriptors(List.of(getDefaultSubmodelDescriptor())).build(); - } @Test public void testReadAasDescriptor() throws IOException, DeserializationException { @@ -432,7 +367,7 @@ public void testReadSubmodelDescriptor() throws IOException, DeserializationExce File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); SubmodelDescriptor submodelDescriptor = new JsonDeserializer().read(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptor); } @@ -443,7 +378,7 @@ public void testReadSubmodelDescriptors() throws IOException, DeserializationExc String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; List submodelDescriptors = new JsonDeserializer().readList(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = getDefaultSubmodelDescriptor(); + SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); } @@ -457,15 +392,5 @@ private void checkImplementationClasses(Environment environment, }); } - static SubmodelDescriptor getDefaultSubmodelDescriptor () { - return new DefaultSubmodelDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .build(); - } + } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 122186f86..dc3e0faae 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -36,11 +36,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.json.JSONException; import org.junit.Assert; @@ -64,7 +62,8 @@ import java.util.List; import java.util.Set; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializerTest.getDefaultSubmodelDescriptor; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; +import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -153,7 +152,7 @@ public void testReadAssetAdministrationShellDescriptor() throws IOException, Ser Assert.assertTrue(fileExpected.exists()); validateAndCompare( Files.readString(fileExpected.toPath()), - serializerToTest.write(JsonDeserializerTest.createAasDescriptor())); + serializerToTest.write(createAasDescriptor())); } @Test @@ -301,7 +300,7 @@ public void testSerializeSpecificAssetIdList() throws SerializationException { @Test public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - validateAndCompare(fileExpected, getDefaultSubmodelDescriptor()); + validateAndCompare(fileExpected, createDefaultSubmodelDescriptor()); } private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 2db1309ab..3e3b8c349 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -4,6 +4,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; @@ -13,7 +14,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; @@ -25,6 +28,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import java.util.List; @@ -106,4 +110,37 @@ public static SpecificAssetId createSpecificAssetId() { .value("testValue") .build(); } + + static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .externalSubjectId(TestDataHelper.createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .specificAssetIds(List.of(specificAssetId)) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .globalAssetId("defaultGlobalAssetId") + .submodelDescriptors(List.of(createDefaultSubmodelDescriptor())).build(); + } + + static SubmodelDescriptor createDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(TestDataHelper.DEFAULT_DESCRIPTION) + .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) + .id(TestDataHelper.DEFAULT_IDENTIFICATION) + .idShort(TestDataHelper.DEFAULT_ID_SHORT) + .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) + .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) + .build(); + } } From 904c08025da38e71944d276afd6ec5ad8ebcb94d Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 15:25:17 +0100 Subject: [PATCH 61/91] Restore the mixins with JsonInclude.annotations --- .../mixins/AssetAdministrationShellMixin.java | 26 ++++++++ .../json/mixins/AssetInformationMixin.java | 33 ++++++++++ .../v3/dataformat/json/mixins/BlobMixin.java | 24 ++++++++ .../DataSpecificationIec61360Mixin.java | 46 ++++++++++++++ .../dataformat/json/mixins/EntityMixin.java | 32 ++++++++++ .../json/mixins/EnvironmentMixin.java | 37 ++++++++++++ .../json/mixins/ExtensionMixin.java | 24 ++++++++ .../v3/dataformat/json/mixins/FileMixin.java | 24 ++++++++ .../json/mixins/IdentifiableMixin.java | 24 ++++++++ .../v3/dataformat/json/mixins/KeyMixin.java | 28 +++++++++ .../json/mixins/OperationVariableMixin.java | 25 ++++++++ .../json/mixins/QualifierMixin.java | 31 ++++++++++ .../v3/dataformat/json/mixins/RangeMixin.java | 23 +++++++ .../json/mixins/ReferenceMixin.java | 36 +++++++++++ .../json/mixins/RelationshipElementMixin.java | 27 +++++++++ .../json/mixins/SubmodelElementListMixin.java | 60 +++++++++++++++++++ 16 files changed, 500 insertions(+) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java new file mode 100644 index 000000000..9975805ad --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; + +public interface AssetAdministrationShellMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + AssetInformation getAssetInformation(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java new file mode 100644 index 000000000..a86d56503 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; + +public interface AssetInformationMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + AssetKind getAssetKind(); + + @JsonProperty("globalAssetId") + String getGlobalAssetId(); + + @JsonProperty("globalAssetId") + void setGlobalAssetId(String globalAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java new file mode 100644 index 000000000..e64dff105 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +public interface BlobMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + String getMimeType(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java new file mode 100644 index 000000000..b3bf5113a --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; + +import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; + +public interface DataSpecificationIec61360Mixin { + + @JsonProperty("levelType") + List getLevelTypes(); + + @JsonProperty("levelType") + void setLevelTypes(List levelTypes); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("preferredName") + List getPreferredName(); + + @JsonProperty("preferredName") + void setPreferredName(List preferredName); + + @JsonProperty("unitId") + Reference getUnitId(); + + public @JsonProperty("unitId") + void setUnitId(Reference unitId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java new file mode 100644 index 000000000..1c1a2753e --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; + +public interface EntityMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + EntityType getEntityType(); + + @JsonProperty("globalAssetId") + String getGlobalAssetId(); + + @JsonProperty("globalAssetId") + void setGlobalAssetId(String globalAssetId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java new file mode 100644 index 000000000..7b337e051 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import java.util.List; +import java.util.Set; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; + +public interface EnvironmentMixin { + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + Set getAssetAdministrationShells(); + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + List getSubmodels(); + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + List getConceptDescriptions(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java new file mode 100644 index 000000000..9c84906bd --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +public interface ExtensionMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + String getName(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java new file mode 100644 index 000000000..b5780799d --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +public interface FileMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + String getContentType(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java new file mode 100644 index 000000000..2d203c018 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +public interface IdentifiableMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + String getId(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java new file mode 100644 index 000000000..a600b260c --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; + +public interface KeyMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + KeyTypes getType(); + + @JsonInclude(JsonInclude.Include.ALWAYS) + String getValue(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java new file mode 100644 index 000000000..608df9adb --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +public interface OperationVariableMixin { + + @JsonInclude(JsonInclude.Include.ALWAYS) + SubmodelElement getValue(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java new file mode 100644 index 000000000..a0cea9c50 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +public interface QualifierMixin { + @JsonInclude(JsonInclude.Include.ALWAYS) + String getType(); + + @JsonProperty("valueId") + Reference getValueId(); + + @JsonProperty("valueId") + void setValueId(Reference valueId); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java new file mode 100644 index 000000000..d7b609ac4 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; + +public interface RangeMixin { + @JsonInclude(JsonInclude.Include.ALWAYS) + String getValueType(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java new file mode 100644 index 000000000..b9be2c816 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; + +import java.util.List; + +public interface ReferenceMixin { + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("keys") + List getKeys(); + + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonProperty("type") + ReferenceTypes getType(); + + @JsonProperty("type") + void setType(ReferenceTypes type); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java new file mode 100644 index 000000000..5bbd6c537 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + +public interface RelationshipElementMixin { + @JsonInclude(JsonInclude.Include.ALWAYS) + Reference getFirst(); + + @JsonInclude(JsonInclude.Include.ALWAYS) + Reference getSecond(); +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java new file mode 100644 index 000000000..931547130 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023 SAP SE + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; + +import java.util.Collection; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; + +public interface SubmodelElementListMixin { + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @JsonProperty("orderRelevant") + boolean getOrdered(); + + @JsonInclude(JsonInclude.Include.NON_DEFAULT) + @JsonProperty("orderRelevant") + void setOrdered(boolean orderRelevant); + + @JsonProperty("semanticIdListElement") + Reference getSemanticIdListElement(); + + @JsonProperty("semanticIdListElement") + void setSemanticIdListElement(Reference semanticIdListElement); + + @JsonProperty("typeValueListElement") + AasSubmodelElements getTypeValueListElement(); + + @JsonProperty("typeValueListElement") + void setTypeValueListElement(AasSubmodelElements typeValueListElement); + + @JsonProperty("valueTypeListElement") + DataTypeDefXsd getValueTypeListElement(); + + @JsonProperty("valueTypeListElement") + void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); + + @JsonProperty("value") + Collection getValue(); + + @JsonProperty("value") + void setValue(Collection value); +} \ No newline at end of file From 70794e3f170aa70ab7482df060174608151e176c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 15:46:17 +0100 Subject: [PATCH 62/91] Revert some changes --- .../v3/dataformat/core/deserialization/EnumDeserializer.java | 1 - .../digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java | 1 - .../digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java | 1 - .../xml/deserialization/ValueReferencePairsDeserializer.java | 1 + .../dataformat/xml/mixins/DataSpecificationIec61360Mixin.java | 1 - dataformat-xml/src/test/resources/invalidXmlExample.xml | 2 +- dataformat-xml/src/test/resources/qualifier_example.xml | 2 +- 7 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java index 767d3b7ae..ebd49fbff 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index ed4a8d646..38965664a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index 8a7aa5a7c..eda8f98f7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java index 9b8fcc78e..37c520e2d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java @@ -15,6 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; + import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; public class ValueReferencePairsDeserializer extends NoEntryWrapperListDeserializer { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java index 649768729..64cf17940 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-xml/src/test/resources/invalidXmlExample.xml b/dataformat-xml/src/test/resources/invalidXmlExample.xml index 9ec4fec01..d8824c2cd 100644 --- a/dataformat-xml/src/test/resources/invalidXmlExample.xml +++ b/dataformat-xml/src/test/resources/invalidXmlExample.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd"> \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/qualifier_example.xml b/dataformat-xml/src/test/resources/qualifier_example.xml index d4b93158d..632f22211 100644 --- a/dataformat-xml/src/test/resources/qualifier_example.xml +++ b/dataformat-xml/src/test/resources/qualifier_example.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd"> TestSubmodel From 28d1a71482470b5ffdc05a739ff1177cabf728a6 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 16:18:47 +0100 Subject: [PATCH 63/91] Add copyright headers --- .../v3/dataformat/aasx/internal/AASXUtils.java | 3 ++- .../aas4j/v3/dataformat/json/TestDataHelper.java | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java index 710318277..d140bc269 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java @@ -1,6 +1,7 @@ /* * Copyright (c) 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java index 3e3b8c349..4f47def14 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java @@ -1,5 +1,18 @@ /* - * Copyright (c) 2023 SAP SE + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; From d0b094d3fd8ebea262bda71ec43981537862687a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 25 Jan 2024 16:50:45 +0100 Subject: [PATCH 64/91] Improve the javadoc --- .../v3/dataformat/json/JsonDeserializer.java | 35 +++++++++---------- .../v3/dataformat/json/JsonSerializer.java | 26 ++++++-------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index ffccd8474..412d69436 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -37,8 +37,6 @@ public class JsonDeserializer { protected SimpleAbstractTypeResolver typeResolver; private JsonMapperFactory jsonMapperFactory; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonDeserializer() { typeResolver = new SimpleAbstractTypeResolverFactory().create(); jsonMapperFactory = new JsonMapperFactory(); @@ -47,10 +45,11 @@ public JsonDeserializer() { /** * Enables usage of custom implementation to be used for deserialization instead of default implementation, e.g. - * defining a custom implementation of the Submodel interface {@code class CustomSubmodel implements Submodel {}} - * and calling {@code useImplementation(Submodel.class, CustomSubmodel.class);} will result in all instances of - * Submodel will be deserialized as CustomSubmodel. Subsequent class with the same aasInterface parameter will - * override the effects of all previous calls. + * defining a custom implementation of the Submodel interface {@code class + * CustomSubmodel implements Submodel {}} and calling + * {@code useImplementation(Submodel.class, CustomSubmodel.class);} will result in all instances of Submodel will be + * deserialized as CustomSubmodel. Subsequent class with the same aasInterface parameter will override the effects + * of all previous calls. * * @param the type of the interface to replace * @param aasInterface the class of the interface to replace @@ -65,7 +64,7 @@ public void useImplementation(Class aasInterface, Class impl * Generic method to deserialize a given string into instance of an AAS type * * @param value a string representation of the AAS instance - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return the instance * @throws DeserializationException if deserialization fails @@ -74,7 +73,7 @@ public T read(String value, Class valueType) throws DeserializationExcept try { return mapper.readValue(value, valueType); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing "+ valueType.getSimpleName(), ex); + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); } } @@ -82,7 +81,7 @@ public T read(String value, Class valueType) throws DeserializationExcept * Generic method to deserialize a given JSON node into instance of an AAS type * * @param node the node to parse - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return an AAS instance * @@ -100,13 +99,13 @@ public T read(JsonNode node, Class valueType) throws DeserializationExcep * Generic method to deserialize a given InputStream into instance of an AAS type, using the default UTF-8 charset * * @param stream An InputStream containing the string representation of the AAS instance - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return an AAS instance * @throws DeserializationException if deserialization fails */ public T read(InputStream stream, Class valueType) throws DeserializationException { - return read(stream, DEFAULT_CHARSET, valueType); + return read(stream, StandardCharsets.UTF_8, valueType); } /** @@ -114,7 +113,7 @@ public T read(InputStream stream, Class valueType) throws Deserialization * * @param stream An InputStream containing the string representation of the AAS instance * @param charset the charset to use for deserialization - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return an AAS instance * @throws DeserializationException if deserialization fails @@ -128,10 +127,10 @@ public T read(InputStream stream, Charset charset, Class valueType) throw } /** - * Deserializes a given string into a list of AAS instances + * Generic method to deserialize a given string into a list of AAS instances * * @param value a string representation of the AAS instances list - * @param valueType the class type of the instance + * @param valueType the class type of the instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails @@ -148,7 +147,7 @@ public List readList(String value, Class valueType) throws Deserializa * Deserializes a given JsonArray into a list of AAS instances * * @param node a JsonArray representing the AAS instances list - * @param valueType the class type of the instance + * @param valueType the class type of the instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails @@ -165,13 +164,13 @@ public List readList(JsonNode node, Class valueType) throws Deserializ * Deserializes a given input stream into a list of AAS instances using the default UTF-8 charset * * @param stream An InputStream containing the string representation of the AAS instances list - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ public List readList(InputStream stream, Class valueType) throws DeserializationException { - return readList(stream, DEFAULT_CHARSET, valueType); + return readList(stream, StandardCharsets.UTF_8, valueType); } /** @@ -179,7 +178,7 @@ public List readList(InputStream stream, Class valueType) throws Deser * * @param stream An InputStream containing the string representation of the AAS instances list * @param charset the charset to use for deserialization - * @param valueType the class type of the AAS instance + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 619ce9796..cc3b60e73 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -51,9 +51,9 @@ public JsonSerializer() { } /** - * Generic method to serialize a given object to a string + * Generic method to serialize a given AAS instance to a string * - * @param aasInstance the object to serialize + * @param aasInstance the AAS instance to serialize * @return the string representation * @throws SerializationException if serialization fails */ @@ -67,9 +67,9 @@ public String write(Object aasInstance) throws SerializationException { } /** - * Generic method to convert a given object to a JSON node + * Generic method to convert a given AAS instance to a JSON node * - * @param aasInstance the object to serialize + * @param aasInstance the AAS instance to serialize * @return the JSON node representation * @throws IllegalArgumentException */ @@ -78,9 +78,9 @@ public JsonNode toNode(Object aasInstance) { } /** - * Generic method to convert a collection of AAS objects to a JSON array + * Generic method to convert a collection of AAS instances to a JSON array * - * @param aasInstances the list of AAS objects to convert + * @param aasInstances the list of AAS instances to convert * @return the JSON array representation * @throws IllegalArgumentException */ @@ -96,11 +96,11 @@ public ArrayNode toArrayNode(Collection aasInstances) { } /** - * Generic method to serialize a given object to an output stream using given charset + * Generic method to serialize a given AAS instance to an output stream using given charset * * @param out the output stream to serialize to * @param charset the charset to use for serialization - * @param aasInstance the object to serialize + * @param aasInstance the AAS instance to serialize * @throws SerializationException if serialization fails */ void write(OutputStream out, Charset charset, Object aasInstance) throws SerializationException { @@ -113,18 +113,14 @@ void write(OutputStream out, Charset charset, Object aasInstance) throws Seriali /** - * Generic method to serialize a given object to an output stream using UTF-8 charset + * Generic method to serialize a given AAS instance to an output stream using UTF-8 charset * * @param out the output stream to serialize to - * @param aasInstance the object to serialize + * @param aasInstance the AAS instance to serialize * @throws SerializationException if serialization fails */ void write(OutputStream out, Object aasInstance) throws SerializationException { - try { - mapper.writeValue(new OutputStreamWriter(out, StandardCharsets.UTF_8), aasInstance); - } catch (IOException ex) { - throw new SerializationException("error serializing " + aasInstance.getClass().getSimpleName() , ex); - } + write(out, StandardCharsets.UTF_8, aasInstance); } /** From ff67d0f4b25d7fd16e8b8771d20119b4a969a564 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 09:46:44 +0100 Subject: [PATCH 65/91] Revert changes in AASXDeserializer --- .../v3/dataformat/aasx/AASXDeserializer.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index a63996f31..069e64cd7 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -15,6 +15,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + import org.apache.commons.io.IOUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -31,16 +41,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.stream.Collectors; - /** * The AASX package converter converts a aasx package into a list of aas, a list * of submodels a list of assets, a list of Concept descriptions From d64960bddb426b40ab6442ad31598c46695d7f66 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 09:48:19 +0100 Subject: [PATCH 66/91] Update AASXSerializer.java --- .../aas4j/v3/dataformat/aasx/AASXSerializer.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index ef2d87e47..a287b121e 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -15,6 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; + import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; @@ -34,14 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.UUID; - /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels From 3f82f254f130adcb25c0a12b0c451b2b87a299e3 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 09:50:20 +0100 Subject: [PATCH 67/91] Update AASXUtils.java --- .../aas4j/v3/dataformat/aasx/internal/AASXUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java index d140bc269..710318277 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java @@ -1,7 +1,6 @@ /* * Copyright (c) 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at From 8a437c9d366d293a14325e37aa5ed3d2513470a9 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 09:52:21 +0100 Subject: [PATCH 68/91] Update AasUtils.java --- .../digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 5f86a38f8..fac5cfeb7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From e36d51d89a8ce294fb5eb613927da65d22f4792c Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 09:54:01 +0100 Subject: [PATCH 69/91] Update EnumSerializer.java --- .../v3/dataformat/core/serialization/EnumSerializer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index 881e87141..56b88f1af 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -53,8 +53,8 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider } } else if (value instanceof DataTypeIec61360) { gen.writeString(value.name().toUpperCase()); - } else if (value instanceof SecurityTypeEnum) { - gen.writeString(value.name().toUpperCase()); + } else if (value instanceof SecurityTypeEnum) { + gen.writeString(value.name().toUpperCase()); } else if (value instanceof Direction || value instanceof StateOfEvent) { gen.writeString(value.name().toLowerCase()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { From e885fc99b21246ec53c9e4a853cef6818d36037e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 10:16:38 +0100 Subject: [PATCH 70/91] Add new test --- .../aas4j/v3/dataformat/core/Examples.java | 18 ------------------ .../dataformat/json/JsonDeserializerTest.java | 16 ++++++++++------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index 21f7dbdcd..437fa5065 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -21,7 +21,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; @@ -31,15 +30,11 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; - public class Examples { public static final Environment EXTENSION_MINIMAL = new DefaultEnvironment.Builder() @@ -92,19 +87,6 @@ public class Examples { .build()) .build(); - public static OperationRequest OPERATION_REQUEST; - static { - try { - OPERATION_REQUEST = new DefaultOperationRequest.Builder() - .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes - .build(); - } catch (DatatypeConfigurationException e) { - OPERATION_REQUEST = new DefaultOperationRequest.Builder() - .build(); - e.printStackTrace(); - } - } - public static final Environment ENVIRONMENT_WITH_DUMMYDATASPEC = new DefaultEnvironment.Builder() .submodels( new DefaultSubmodel.Builder() diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 0d7fc64cb..4c31dad16 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -41,6 +41,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; @@ -292,7 +293,7 @@ public void testReadAasDescriptor() throws IOException, DeserializationException File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = - new JsonDeserializer().read(expected, AssetAdministrationShellDescriptor.class); + deserializerToTest.read(expected, AssetAdministrationShellDescriptor.class); AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); assertEquals(aasExpected, assetAdministrationShellDescriptor); @@ -310,12 +311,15 @@ public void testReadAasDescriptorsList() throws IOException, DeserializationExce } @Test - public void testDeserializeDuration() throws DeserializationException, DatatypeConfigurationException, SerializationException { + public void testDeserializeOperationRequest() throws DeserializationException, DatatypeConfigurationException, SerializationException { + OperationRequest expected = new DefaultOperationRequest.Builder() + .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes + .build(); Duration duration = DatatypeFactory.newInstance().newDurationDayTime("P0DT0H3M0S"); // three minutes - JsonDeserializer deserializer = new JsonDeserializer(); - String operationRequestString = new JsonSerializer().write(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.OPERATION_REQUEST); - OperationRequest operationRequest = deserializer.read(operationRequestString, OperationRequest.class); - assertEquals( operationRequest.getClientTimeoutDuration() , duration); + String operationRequestString = new JsonSerializer().write(expected); + OperationRequest actual = deserializerToTest.read(operationRequestString, OperationRequest.class); + assertEquals( actual.getClientTimeoutDuration() , duration); + assertEquals(expected, actual); } @Test From dc47ba4d4eeda8a880e413b4658a11266310da66 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 10:38:23 +0100 Subject: [PATCH 71/91] Update JsonDeserializer.java --- .../aas4j/v3/dataformat/json/JsonDeserializer.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 412d69436..1f37cbdf3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -16,12 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; - import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -29,6 +23,13 @@ import java.nio.charset.StandardCharsets; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; + /** * Class for deserializing/parsing AAS JSON documents. */ From 70e8ab42a70c2a17a079aeda2bfd72e7d3546ea7 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 10:51:02 +0100 Subject: [PATCH 72/91] Update JsonMapperFactory.java --- .../v3/dataformat/json/JsonMapperFactory.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index b6f7da5aa..a849c7370 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +16,14 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.SerializationFeature; @@ -24,13 +31,6 @@ import com.fasterxml.jackson.databind.json.JsonMapper.Builder; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; - -import java.util.Arrays; -import java.util.List; /** * Factory for creating a {@link JsonMapper} configured to produce and consume AAS Version 3 conformant JSON serializations @@ -44,7 +44,7 @@ public JsonMapper create(SimpleAbstractTypeResolver typeResolver) { Builder builder = JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) .annotationIntrospector(new ReflectionAnnotationIntrospector()) - .serializationInclusion(JsonInclude.Include.NON_EMPTY); + .serializationInclusion(JsonInclude.Include.NON_NULL); getModulesToInstall(typeResolver).stream().forEach(m -> builder.addModule(m)); From 2ee906716d6c7df7a9e7541277e00679780f0a74 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 10:54:33 +0100 Subject: [PATCH 73/91] Update JsonSerializer.java --- .../v3/dataformat/json/JsonSerializer.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index cc3b60e73..3b3892759 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -16,22 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -40,6 +24,14 @@ import java.util.Collection; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; + /** * Class for serializing of AAS instances. */ From ba185f15e3eb7e0b7c952c532361ed687b1e1d89 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 11:00:55 +0100 Subject: [PATCH 74/91] Update SimpleAbstractTypeResolverFactory.java --- .../v3/dataformat/json/SimpleAbstractTypeResolverFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java index 54ccfd8fb..742af85ab 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java @@ -16,9 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; + /** * Factory for creating a {@link SimpleAbstractTypeResolver} configured with the * Default Implementations of AAS4J From 9bc5caeb9bdeed0fbb55f65132f131d1472fe055 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 13:48:02 +0100 Subject: [PATCH 75/91] Fix the mixins --- .../mixins/AssetAdministrationShellMixin.java | 7 ++-- .../json/mixins/AssetInformationMixin.java | 12 +----- .../v3/dataformat/json/mixins/BlobMixin.java | 1 - .../DataSpecificationIec61360Mixin.java | 25 ++---------- .../dataformat/json/mixins/EndpointMixin.java | 3 -- .../dataformat/json/mixins/EntityMixin.java | 10 +---- .../json/mixins/EnvironmentMixin.java | 5 +-- .../json/mixins/ExtensionMixin.java | 1 - .../v3/dataformat/json/mixins/FileMixin.java | 1 - .../json/mixins/IdentifiableMixin.java | 1 - .../v3/dataformat/json/mixins/KeyMixin.java | 4 +- .../json/mixins/OperationVariableMixin.java | 4 +- .../json/mixins/QualifierMixin.java | 8 ---- .../json/mixins/ReferenceMixin.java | 13 ++---- .../json/mixins/RelationshipElementMixin.java | 3 +- .../json/mixins/SubmodelElementListMixin.java | 40 +------------------ 16 files changed, 24 insertions(+), 114 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java index 9975805ad..b71c21b9e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java @@ -15,12 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -public interface AssetAdministrationShellMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface AssetAdministrationShellMixin { @JsonInclude(JsonInclude.Include.ALWAYS) AssetInformation getAssetInformation(); -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index a86d56503..d5fc45b33 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -15,19 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -public interface AssetInformationMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface AssetInformationMixin { @JsonInclude(JsonInclude.Include.ALWAYS) AssetKind getAssetKind(); - - @JsonProperty("globalAssetId") - String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java index e64dff105..23ed61c3f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface BlobMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index b3bf5113a..9653720d3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -15,32 +15,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; - import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -public interface DataSpecificationIec61360Mixin { - - @JsonProperty("levelType") - List getLevelTypes(); +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; - @JsonProperty("levelType") - void setLevelTypes(List levelTypes); +import com.fasterxml.jackson.annotation.JsonInclude; +public interface DataSpecificationIec61360Mixin { @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("preferredName") List getPreferredName(); - - @JsonProperty("preferredName") - void setPreferredName(List preferredName); - - @JsonProperty("unitId") - Reference getUnitId(); - - public @JsonProperty("unitId") - void setUnitId(Reference unitId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java index c0570ffe8..da1f46232 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java @@ -19,12 +19,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; public interface EndpointMixin { - - @JsonProperty("interface") String get_interface(); @JsonProperty("interface") void set_interface(String _interface); - } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index 1c1a2753e..189a273ce 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -15,18 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import com.fasterxml.jackson.annotation.JsonInclude; + public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) EntityType getEntityType(); - - @JsonProperty("globalAssetId") - String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - void setGlobalAssetId(String globalAssetId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java index 7b337e051..11261f1b3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java @@ -18,14 +18,13 @@ import java.util.List; import java.util.Set; -import com.fasterxml.jackson.annotation.JsonInclude; - import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -public interface EnvironmentMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface EnvironmentMixin { @JsonInclude(JsonInclude.Include.NON_EMPTY) Set getAssetAdministrationShells(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java index 9c84906bd..06240b00a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface ExtensionMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) String getName(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index b5780799d..e32942542 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface FileMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java index 2d203c018..96d0dfd8d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface IdentifiableMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) String getId(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java index a600b260c..26de3024d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java @@ -15,11 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -public interface KeyMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface KeyMixin { @JsonInclude(JsonInclude.Include.ALWAYS) KeyTypes getType(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java index 608df9adb..aec20388d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java @@ -15,11 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -public interface OperationVariableMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface OperationVariableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) SubmodelElement getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index a0cea9c50..53f937f59 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -16,16 +16,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { @JsonInclude(JsonInclude.Include.ALWAYS) String getType(); - - @JsonProperty("valueId") - Reference getValueId(); - - @JsonProperty("valueId") - void setValueId(Reference valueId); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java index b9be2c816..222de6026 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java @@ -15,22 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; public interface ReferenceMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("keys") List getKeys(); @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("type") ReferenceTypes getType(); - - @JsonProperty("type") - void setType(ReferenceTypes type); -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java index 5bbd6c537..cc3adb685 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java @@ -15,9 +15,10 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import com.fasterxml.jackson.annotation.JsonInclude; + public interface RelationshipElementMixin { @JsonInclude(JsonInclude.Include.ALWAYS) Reference getFirst(); diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 931547130..3ea2fa1b1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -17,44 +17,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; public interface SubmodelElementListMixin { - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - boolean getOrdered(); - - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - void setOrdered(boolean orderRelevant); - - @JsonProperty("semanticIdListElement") - Reference getSemanticIdListElement(); - - @JsonProperty("semanticIdListElement") - void setSemanticIdListElement(Reference semanticIdListElement); - - @JsonProperty("typeValueListElement") - AasSubmodelElements getTypeValueListElement(); - - @JsonProperty("typeValueListElement") - void setTypeValueListElement(AasSubmodelElements typeValueListElement); - - @JsonProperty("valueTypeListElement") - DataTypeDefXsd getValueTypeListElement(); - - @JsonProperty("valueTypeListElement") - void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); - - @JsonProperty("value") - Collection getValue(); - - @JsonProperty("value") - void setValue(Collection value); + @JsonInclude(JsonInclude.Include.ALWAYS) + boolean getOrderRelevant(); } \ No newline at end of file From 16e985fc57e8453f562a3b7d856345fe818125ee Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 14:12:22 +0100 Subject: [PATCH 76/91] Improve serialization tests --- .../dataformat/json/JsonDeserializerTest.java | 43 +++++++++-------- .../dataformat/json/JsonSerializerTest.java | 47 +++++++++---------- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 4c31dad16..8c724ac53 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -14,10 +14,23 @@ * limitations under the License. */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.Collections; +import java.util.List; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; + import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; @@ -51,18 +64,9 @@ import org.junit.Ignore; import org.junit.Test; -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Collections; -import java.util.List; - import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -304,9 +308,8 @@ public void testReadAasDescriptorsList() throws IOException, DeserializationExce File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; List assetAdministrationShellDescriptors = - new JsonDeserializer().readList(expected, AssetAdministrationShellDescriptor.class); + deserializerToTest.readList(expected, AssetAdministrationShellDescriptor.class); AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); - assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); } @@ -324,17 +327,15 @@ public void testDeserializeOperationRequest() throws DeserializationException, D @Test public void testDeserializeReference() throws DeserializationException, SerializationException { - JsonDeserializer deserializer = new JsonDeserializer(); String jsonReference = new JsonSerializer().write(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); - Reference reference = deserializer.read(jsonReference, Reference.class); + Reference reference = deserializerToTest.read(jsonReference, Reference.class); assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); } @Test public void testDeserializeReferenceList() throws DeserializationException, SerializationException { - JsonDeserializer deserializer = new JsonDeserializer(); String jsonReferenceList = new JsonSerializer().writeList(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); - List referenceList = deserializer.readList(jsonReferenceList, Reference.class); + List referenceList = deserializerToTest.readList(jsonReferenceList, Reference.class); assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); } @@ -346,8 +347,7 @@ public void testDeserializeSpecificAssetId() throws DeserializationException, Se .build(); String specificAssetIdString = new JsonSerializer().write(expected); - JsonDeserializer deserializer = new JsonDeserializer(); - assertEquals(expected, deserializer.read(specificAssetIdString, SpecificAssetId.class)); + assertEquals(expected, deserializerToTest.read(specificAssetIdString, SpecificAssetId.class)); } @Test @@ -360,8 +360,7 @@ public void testDeserializeSpecificAssetIdList() throws DeserializationException .build(); String specificAssetId_list_string = serializer.writeList(List.of(expected)); - JsonDeserializer deserializer = new JsonDeserializer(); - List specificAssetIdList = deserializer.readList( + List specificAssetIdList = deserializerToTest.readList( specificAssetId_list_string, SpecificAssetId.class); assertEquals(expected, specificAssetIdList.get(0)); } @@ -370,7 +369,7 @@ public void testDeserializeSpecificAssetIdList() throws DeserializationException public void testReadSubmodelDescriptor() throws IOException, DeserializationException { File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = Files.readString(fileExpected.toPath()); - SubmodelDescriptor submodelDescriptor = new JsonDeserializer().read(expected, SubmodelDescriptor.class); + SubmodelDescriptor submodelDescriptor = deserializerToTest.read(expected, SubmodelDescriptor.class); SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptor); @@ -381,7 +380,7 @@ public void testReadSubmodelDescriptors() throws IOException, DeserializationExc File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; List submodelDescriptors = - new JsonDeserializer().readList(expected, SubmodelDescriptor.class); + deserializerToTest.readList(expected, SubmodelDescriptor.class); SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index dc3e0faae..b2fcac96d 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -16,10 +16,16 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; @@ -40,6 +46,11 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + import org.json.JSONException; import org.junit.Assert; import org.junit.BeforeClass; @@ -52,18 +63,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; - import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -268,17 +270,15 @@ public void testSerializeReference() throws SerializationException, Deserializat @Test public void testSerializeReferenceList() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); - String serializedReferenceArray = serializer.write(referenceList); + String serializedReferenceArray = serializerToTest.write(referenceList); assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); } @Test public void testSerializeSpecificAssetId() throws SerializationException { - JsonSerializer serializer = new JsonSerializer(); SpecificAssetId specificAssetId = TestDataHelper.createSpecificAssetId(); - String specificAssetId_string = serializer.write(specificAssetId); + String specificAssetId_string = serializerToTest.write(specificAssetId); assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); } @@ -291,8 +291,7 @@ public void testSerializeSpecificAssetIdList() throws SerializationException { add(specificAssetId); }}; - JsonSerializer serializer = new JsonSerializer(); - String specificAssetId_list_string = serializer.writeList(specificAssetIds); + String specificAssetId_list_string = serializerToTest.writeList(specificAssetIds); assertTrue(specificAssetId_list_string.startsWith("[")); assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); } @@ -305,7 +304,7 @@ public void testReadSubmodelDescriptor() throws IOException, SerializationExcept private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { String expected = Files.readString(expectedFile.toPath()); - String actual = new JsonSerializer().write(descriptor); + String actual = serializerToTest.write(descriptor); validateAndCompare(expected, actual); } @@ -315,9 +314,9 @@ private void compare(ExampleData exampleData) throws IOException, Serializati String expected = exampleData.fileContent(); String actual; if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().writeList((Collection) exampleData.getModel()); + actual = serializerToTest.writeList((Collection) exampleData.getModel()); } else { - actual = new JsonSerializer().write(exampleData.getModel()); + actual = serializerToTest.write(exampleData.getModel()); } //validateAndCompare(expected, actual); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); @@ -326,7 +325,7 @@ private void compare(ExampleData exampleData) throws IOException, Serializati private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); - String actual = new JsonSerializer().write(exampleData.getModel()); + String actual = serializerToTest.write(exampleData.getModel()); validateAndCompare(expected, actual); } From 2408ccd3b8a4efc57cd56bc6f84cb32522c9ec3d Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 15:42:56 +0100 Subject: [PATCH 77/91] Update JsonSerializerTest.java --- .../digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index b2fcac96d..f92ac715c 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -318,7 +318,6 @@ private void compare(ExampleData exampleData) throws IOException, Serializati } else { actual = serializerToTest.write(exampleData.getModel()); } - //validateAndCompare(expected, actual); JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } From 941fe76a13ca011509d0e331c168e9c55f234575 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 15:47:25 +0100 Subject: [PATCH 78/91] Update EmbeddedDataSpecificationsDeserializer.java --- .../deserialization/EmbeddedDataSpecificationsDeserializer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 79e83c5c6..ea0b54ff6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 8574255e197464093b8c7ffcbbcc245eb68f6ebd Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 15:51:30 +0100 Subject: [PATCH 79/91] revert some changes --- .../xml/deserialization/ValueReferencePairNodeDeserializer.java | 1 + .../xml/deserialization/ValueReferencePairsDeserializer.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java index 219d25ff9..0d4c23a07 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import com.fasterxml.jackson.core.JsonParser; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java index 37c520e2d..9b8fcc78e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java @@ -15,7 +15,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; - import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; public class ValueReferencePairsDeserializer extends NoEntryWrapperListDeserializer { From 6412ce7d8934796d6d6342eb1dec1074329d23d2 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 26 Jan 2024 16:01:52 +0100 Subject: [PATCH 80/91] Delete LangString.java --- .../aas4j/v3/model/LangString.java | 93 ------------------- 1 file changed, 93 deletions(-) delete mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java deleted file mode 100644 index e9c52a8bb..000000000 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/LangString.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023, SAP SE or an SAP affiliate company - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License - * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - * or implied. See the License for the specific language governing permissions and limitations under - * the License. - */ - -package org.eclipse.digitaltwin.aas4j.v3.model; - -import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; - -import java.io.Serializable; -import java.util.Objects; - - -@IRI("rdf:langString") -public class LangString implements Serializable { - - private String language = null; - private String value = null; - - public LangString() { - super(); - } - - public LangString(String valueAndLanguage) { - if (valueAndLanguage.contains("@")) { - String[] splitString = valueAndLanguage.split("@"); - this.value = splitString[0]; - this.language = splitString[1]; - } else { - this.value = valueAndLanguage; - } - } - - public LangString(String value, String language) { - this.value = value; - this.language = language; - } - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } else if (obj == null) { - return false; - } else if (this.getClass() != obj.getClass()) { - return false; - } else { - LangString other = (LangString) obj; - return Objects.equals(this.language, other.language) && Objects.equals(this.value, other.value); - } - } - - @Override - public int hashCode() { - return Objects.hash(this.language, this.value); - } - - @Override - public String toString() { - String result = this.value; - if (this.language != null && !this.language.isEmpty()) { - return "\"" + result + "\"@" + this.language; - } - return result; - } - -} From f95d0451fc4c49dc8915e210fe9f92becb1ee24d Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 31 Jan 2024 14:30:46 +0100 Subject: [PATCH 81/91] Fix testSerializeCustomDataSpecification --- .../dataformat/json/JsonSerializerTest.java | 15 +----- .../v3/dataformat/json/util/Examples.java | 4 ++ .../resources/Environment-CustomDataSpec.json | 48 +++++++++++++++++++ 3 files changed, 54 insertions(+), 13 deletions(-) create mode 100644 dataformat-json/src/test/resources/Environment-CustomDataSpec.json diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index f92ac715c..8ad102481 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -130,22 +130,11 @@ public void testSerializeEmptyReferableList() throws SerializationException, JSO * @throws DeserializationException */ @Test - public void testSerializeCustomDataSpecification() throws SerializationException, DeserializationException { - JsonDeserializer deserializer = new JsonDeserializer(); - + public void testSerializeCustomDataSpecification() throws SerializationException, IOException, JSONException { // This is the only way to make the serialization to work. Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); subtypes.add(DefaultDummyDataSpecification.class); - - Environment origin = org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC; - - String jsonString = serializerToTest.write(origin); - assertNotNull(jsonString); - - Environment copy = deserializer.read(jsonString, Environment.class); - assertNotNull(copy); - - assertTrue(origin.equals(copy)); + compare(Examples.ENVIRONMENT_CUSTOM_DATA); } @Test diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 0f6a667c0..d0cac34d5 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -50,6 +50,10 @@ public class Examples { public static final ExampleData ENVIRONMENT_EMPTY = ExampleData.of(new DefaultEnvironment.Builder().build(), "Environment-Empty.json"); + public static final ExampleData ENVIRONMENT_CUSTOM_DATA = ExampleData.of( + org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC, + "Environment-CustomDataSpec.json"); + public static final ExampleData> ASSET_ADMINISTRATION_SHELL_LIST_OF = ExampleData.of( List.of(AASFull.createEnvironment().getAssetAdministrationShells().get(0), AASFull.createEnvironment().getAssetAdministrationShells().get(1)), diff --git a/dataformat-json/src/test/resources/Environment-CustomDataSpec.json b/dataformat-json/src/test/resources/Environment-CustomDataSpec.json new file mode 100644 index 000000000..976b90bcf --- /dev/null +++ b/dataformat-json/src/test/resources/Environment-CustomDataSpec.json @@ -0,0 +1,48 @@ +{ + "submodels" : [ { + "modelType" : "Submodel", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "https://admin-shell.io/aas/3/0/CustomDataSpecification" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DefaultDummyDataSpecification", + "name" : { + "language" : "en", + "text" : "myName" + }, + "text" : "myText", + "pages" : 42 + } + }, { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIec61360", + "dataType" : "BLOB", + "definition" : [ { + "language" : "en", + "text" : "myDefinition" + } ], + "preferredName" : [ ] + } + } ], + "kind" : "Instance", + "id" : "urn:test", + "submodelElements" : [ { + "modelType" : "File", + "contentType" : null, + "value" : "FileValue", + "idShort" : "myIdShort" + } ] + } ] +} \ No newline at end of file From 545d9f12ef6b1744d33b7d680999db2f13ae31f8 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 31 Jan 2024 14:41:17 +0100 Subject: [PATCH 82/91] add testReadCustomDataSpecification --- .../dataformat/json/JsonDeserializerTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 8c724ac53..8d9065c81 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -21,6 +21,7 @@ import java.nio.file.Files; import java.util.Collections; import java.util.List; +import java.util.Set; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; @@ -38,10 +39,13 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Property; @@ -59,6 +63,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.json.JSONException; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; @@ -85,6 +90,22 @@ public void testReadEnvironmentFromStream() throws DeserializationException { assertEquals(Examples.EXAMPLE_FULL.getModel(), env); } + /** + * This test ensures that future DataSpecificationContents can be added without adjustments in the code. + * + * @throws SerializationException + * @throws DeserializationException + */ + @Test + public void testReadCustomDataSpecification() throws DeserializationException { + // This is the only way to make the serialization to work. + Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); + subtypes.add(DefaultDummyDataSpecification.class); + // We need to create a new deserializer instance here, to reflect the change in the subtypes. + Environment env = new JsonDeserializer().read(Examples.ENVIRONMENT_CUSTOM_DATA.fileContentStream(), Environment.class); + assertEquals(Examples.ENVIRONMENT_CUSTOM_DATA.getModel(), env); + } + @Test public void testReadReferable() throws IOException, DeserializationException { Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContent(), Submodel.class); From 399cd4a11d16fd9c5f0c19a42671c763ad389278 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Wed, 31 Jan 2024 16:37:38 +0100 Subject: [PATCH 83/91] Remove TestDataHelper --- .../dataformat/json/JsonDeserializerTest.java | 42 ++--- .../dataformat/json/JsonSerializerTest.java | 46 +++-- .../v3/dataformat/json/TestDataHelper.java | 159 ------------------ .../v3/dataformat/json/util/Examples.java | 159 +++++++++++++++--- 4 files changed, 168 insertions(+), 238 deletions(-) delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 8d9065c81..d0e6d8b22 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -63,20 +63,15 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.json.JSONException; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { - private static JsonDeserializer deserializerToTest; @BeforeClass @@ -315,23 +310,17 @@ public void testExtensionMaximal() throws Exception { @Test public void testReadAasDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - String expected = Files.readString(fileExpected.toPath()); - AssetAdministrationShellDescriptor assetAdministrationShellDescriptor = - deserializerToTest.read(expected, AssetAdministrationShellDescriptor.class); - AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); - - assertEquals(aasExpected, assetAdministrationShellDescriptor); + AssetAdministrationShellDescriptor shellDescriptor = + deserializerToTest.read(Examples.SHELL_DESCRIPTOR.fileContent(), AssetAdministrationShellDescriptor.class); + assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptor); } @Test public void testReadAasDescriptorsList() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; - List assetAdministrationShellDescriptors = - deserializerToTest.readList(expected, AssetAdministrationShellDescriptor.class); - AssetAdministrationShellDescriptor aasExpected = createAasDescriptor(); - assertEquals(aasExpected, assetAdministrationShellDescriptors.get(0)); + String jsonString = "[" + Examples.SHELL_DESCRIPTOR.fileContent() + "]"; + List shellDescriptors = + deserializerToTest.readList(jsonString, AssetAdministrationShellDescriptor.class); + assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptors.get(0)); } @Test @@ -388,22 +377,17 @@ public void testDeserializeSpecificAssetIdList() throws DeserializationException @Test public void testReadSubmodelDescriptor() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - String expected = Files.readString(fileExpected.toPath()); - SubmodelDescriptor submodelDescriptor = deserializerToTest.read(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); - - assertEquals(submodelDescriptorExpected, submodelDescriptor); + SubmodelDescriptor submodelDescriptor = deserializerToTest.read( + Examples.SUBMODEL_DESCRIPTOR.fileContentStream(), SubmodelDescriptor.class); + assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptor); } @Test public void testReadSubmodelDescriptors() throws IOException, DeserializationException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - String expected = "[" + Files.readString(fileExpected.toPath()) + "]"; + String jsonString = "[" + Examples.SUBMODEL_DESCRIPTOR.fileContent() + "]"; List submodelDescriptors = - deserializerToTest.readList(expected, SubmodelDescriptor.class); - SubmodelDescriptor submodelDescriptorExpected = createDefaultSubmodelDescriptor(); - assertEquals(submodelDescriptorExpected, submodelDescriptors.get(0)); + deserializerToTest.readList(jsonString, SubmodelDescriptor.class); + assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptors.get(0)); } private void checkImplementationClasses(Environment environment, diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 8ad102481..1299cfb8e 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -20,7 +20,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -46,7 +45,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -63,11 +61,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createAasDescriptor; -import static org.eclipse.digitaltwin.aas4j.v3.dataformat.json.TestDataHelper.createDefaultSubmodelDescriptor; - import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class JsonSerializerTest { @@ -139,11 +133,7 @@ public void testSerializeCustomDataSpecification() throws SerializationException @Test public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/AssetAdministrationShellDescriptor.json"); - Assert.assertTrue(fileExpected.exists()); - validateAndCompare( - Files.readString(fileExpected.toPath()), - serializerToTest.write(createAasDescriptor())); + compare(Examples.SHELL_DESCRIPTOR); } @Test @@ -183,7 +173,7 @@ public void testSerializeSubmodelElement() throws IOException, SerializationExce } @Test - public void testSerializeSubmodelWithExtensions() throws DeserializationException, SerializationException, JsonProcessingException { + public void testSerializeSubmodelWithExtensions() throws DeserializationException { List extensions = List.of( new DefaultExtension.Builder() .name("myExtension").value("my extension value").valueType(DataTypeDefXsd.STRING) @@ -265,30 +255,32 @@ public void testSerializeReferenceList() throws SerializationException { } @Test - public void testSerializeSpecificAssetId() throws SerializationException { - SpecificAssetId specificAssetId = TestDataHelper.createSpecificAssetId(); - String specificAssetId_string = serializerToTest.write(specificAssetId); - assertTrue(specificAssetId_string.contains("\"value\" : \"testValue\"")); + public void testSerializeSpecificAssetId() throws SerializationException, JSONException, IOException { + SpecificAssetId specificAssetId = Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION + .getModel().getAssetInformation().getSpecificAssetIds().get(0); + + String jsonString = serializerToTest.write(specificAssetId); + assertTrue(jsonString.contains("\"name\"")); + assertTrue(jsonString.contains("\"value\"")); + } @Test - public void testSerializeSpecificAssetIdList() throws SerializationException { - SpecificAssetId specificAssetId = TestDataHelper.createSpecificAssetId(); - List specificAssetIds = new ArrayList<>() {{ - add(specificAssetId); - add(specificAssetId); - }}; + public void testSerializeSpecificAssetIdList() throws SerializationException, IOException { + List specificAssetIds = Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION + .getModel().getAssetInformation().getSpecificAssetIds(); - String specificAssetId_list_string = serializerToTest.writeList(specificAssetIds); - assertTrue(specificAssetId_list_string.startsWith("[")); - assertTrue(specificAssetId_list_string.contains("\"name\" : \"testSpecificAssetId\"")); + String jsonString = serializerToTest.writeList(specificAssetIds); + assertTrue(jsonString.contains("\"name\"")); + assertTrue(jsonString.contains("\"value\"")); + assertTrue(jsonString.startsWith("[")); + assertTrue(jsonString.endsWith("]")); } @Test public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { - File fileExpected = new File("src/test/resources/SubmodelDescriptor.json"); - validateAndCompare(fileExpected, createDefaultSubmodelDescriptor()); + compare(Examples.SUBMODEL_DESCRIPTOR); } private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java deleted file mode 100644 index 4f47def14..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/TestDataHelper.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Key; -import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; - -import java.util.List; - -public class TestDataHelper { - - public static final String DEFAULT_IDENTIFICATION = "identification"; - - public static final Reference DEFAULT_SEMANTIC_ID = - new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) - .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) - .build(); - - public static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() - .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() - .preferredName( - new DefaultLangStringPreferredNameTypeIec61360.Builder().language("en").text("defaultPreferredName").build()) - .build()) - .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); - - public static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = - new DefaultAdministrativeInformation.Builder() - .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) - .revision("1") - .version("1").build(); - - public static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); - - public static final List DEFAULT_DISPLAY_NAME = List.of(createLangStringNameType("en", "defaultDisplayName")); - - public static final String DEFAULT_ID_SHORT = "defaultIdShort"; - - public static LangStringTextType createLangStringTextType(String langCode, String text) { - return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); - } - - public static LangStringNameType createLangStringNameType(String langCode, String text) { - return new DefaultLangStringNameType.Builder().language(langCode).text(text).build(); - } - - public static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { - return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); - } - - public static Reference createGlobalReference(String value) { - return createReference(ReferenceTypes.EXTERNAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); - } - - public static DefaultEndpoint.Builder createEndpointBuilder() { - - String DEFAULT_INTERFACE_VALUE = "defaultInterface"; - - return new DefaultEndpoint.Builder() - .protocolInformation(createProtocolInformationBuilder().build()) - ._interface(DEFAULT_INTERFACE_VALUE); - } - - public static Key createKey(KeyTypes type, String value) { - return new DefaultKey.Builder().type(type).value(value).build(); - } - - public static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { - return new DefaultProtocolInformation.Builder() - .href("defaultEndpointAddress") - .endpointProtocol("defaultEndpointProtocol") - .endpointProtocolVersion(List.of("defaultEndpointProtocolVersion")) - .subprotocol("defaultSubprotocol") - .subprotocolBody("defaultSubprotocolBody") - .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding") - .securityAttributes(new DefaultSecurityAttributeObject.Builder() - .key("NONE") - .type(SecurityTypeEnum.NONE) - .value("NONE") - .build()); - } - - public static SpecificAssetId createSpecificAssetId() { - return new DefaultSpecificAssetId.Builder() - .name("testSpecificAssetId") - .value("testValue") - .build(); - } - - static AssetAdministrationShellDescriptor createAasDescriptor() { - - SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .externalSubjectId(TestDataHelper.createReference( - ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) - .name("defaultSpecificAssetIdName") - .value("http://example.company/myAsset").build(); - - return new DefaultAssetAdministrationShellDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .specificAssetIds(List.of(specificAssetId)) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .globalAssetId("defaultGlobalAssetId") - .submodelDescriptors(List.of(createDefaultSubmodelDescriptor())).build(); - } - - static SubmodelDescriptor createDefaultSubmodelDescriptor () { - return new DefaultSubmodelDescriptor.Builder() - .administration(TestDataHelper.DEFAULT_ADMINISTRATIVE_INFORMATION) - .description(TestDataHelper.DEFAULT_DESCRIPTION) - .displayName(TestDataHelper.DEFAULT_DISPLAY_NAME) - .id(TestDataHelper.DEFAULT_IDENTIFICATION) - .idShort(TestDataHelper.DEFAULT_ID_SHORT) - .endpoints(List.of(TestDataHelper.createEndpointBuilder().build())) - .semanticId(TestDataHelper.DEFAULT_SEMANTIC_ID) - .build(); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index d0cac34d5..0fa6fb644 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -18,32 +18,160 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import java.util.List; - public class Examples { + private static final String DEFAULT_IDENTIFICATION = "identification"; + + private static final Reference DEFAULT_SEMANTIC_ID = + new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) + .build(); + + private static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName( + new DefaultLangStringPreferredNameTypeIec61360.Builder().language("en").text("defaultPreferredName").build()) + .build()) + .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); + + private static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = + new DefaultAdministrativeInformation.Builder() + .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) + .revision("1") + .version("1").build(); + + private static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); + + private static final List DEFAULT_DISPLAY_NAME = List.of(createLangStringNameType("en", "defaultDisplayName")); + + private static final String DEFAULT_ID_SHORT = "defaultIdShort"; + + private static LangStringTextType createLangStringTextType(String langCode, String text) { + return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); + } + + private static LangStringNameType createLangStringNameType(String langCode, String text) { + return new DefaultLangStringNameType.Builder().language(langCode).text(text).build(); + } + + private static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { + return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); + } + + private static Reference createGlobalReference(String value) { + return createReference(ReferenceTypes.EXTERNAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + } + + private static DefaultEndpoint.Builder createEndpointBuilder() { + + String DEFAULT_INTERFACE_VALUE = "defaultInterface"; + + return new DefaultEndpoint.Builder() + .protocolInformation(createProtocolInformationBuilder().build()) + ._interface(DEFAULT_INTERFACE_VALUE); + } + + private static Key createKey(KeyTypes type, String value) { + return new DefaultKey.Builder().type(type).value(value).build(); + } + + private static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { + return new DefaultProtocolInformation.Builder() + .href("defaultEndpointAddress") + .endpointProtocol("defaultEndpointProtocol") + .endpointProtocolVersion(List.of("defaultEndpointProtocolVersion")) + .subprotocol("defaultSubprotocol") + .subprotocolBody("defaultSubprotocolBody") + .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding") + .securityAttributes(new DefaultSecurityAttributeObject.Builder() + .key("NONE") + .type(SecurityTypeEnum.NONE) + .value("NONE") + .build()); + } + + private static SpecificAssetId createSpecificAssetId() { + return new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + } + + private static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(DEFAULT_SEMANTIC_ID) + .externalSubjectId(createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(DEFAULT_DESCRIPTION) + .displayName(DEFAULT_DISPLAY_NAME) + .id(DEFAULT_IDENTIFICATION) + .idShort(DEFAULT_ID_SHORT) + .specificAssetIds(List.of(specificAssetId)) + .endpoints(List.of(createEndpointBuilder().build())) + .globalAssetId("defaultGlobalAssetId") + .submodelDescriptors(List.of(createDefaultSubmodelDescriptor())).build(); + } + + private static SubmodelDescriptor createDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(DEFAULT_DESCRIPTION) + .displayName(DEFAULT_DISPLAY_NAME) + .id(DEFAULT_IDENTIFICATION) + .idShort(DEFAULT_ID_SHORT) + .endpoints(List.of(createEndpointBuilder().build())) + .semanticId(DEFAULT_SEMANTIC_ID) + .build(); + } public static final ExampleData EXAMPLE_FULL = ExampleData.of(AASFull.createEnvironment(), "Example-Full.json"); public static final ExampleData EXAMPLE_SIMPLE = ExampleData.of(AASSimple.createEnvironment(), "Example-Simple.json"); @@ -54,6 +182,12 @@ public class Examples { org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC, "Environment-CustomDataSpec.json"); + public static final ExampleData SHELL_DESCRIPTOR = ExampleData.of( + createAasDescriptor(), "AssetAdministrationShellDescriptor.json"); + + public static final ExampleData SUBMODEL_DESCRIPTOR = ExampleData.of( + createDefaultSubmodelDescriptor(), "SubmodelDescriptor.json"); + public static final ExampleData> ASSET_ADMINISTRATION_SHELL_LIST_OF = ExampleData.of( List.of(AASFull.createEnvironment().getAssetAdministrationShells().get(0), AASFull.createEnvironment().getAssetAdministrationShells().get(1)), @@ -86,6 +220,7 @@ public class Examples { public static final ExampleData ASSET_ADMINISTRATION_SHELL = ExampleData.of(AASFull.createEnvironment().getAssetAdministrationShells().get(0), "AssetAdministrationShell.json"); + public static final ExampleData CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT = ExampleData.of( new DefaultConceptDescription.Builder() .id("https://example.org/ConceptDescription") @@ -98,28 +233,6 @@ public class Examples { .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02") .build()) .build()) - // .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() - // .conversionFactor("1.0") - // .eceCode("ece-code") - // .eceName("ece-name") - // .definition(new DefaultLangString.Builder() - // .language("en") - // .text("definition-en") - // .build()) - // .definition(new DefaultLangString.Builder() - // .language("de") - // .text("definition-de") - // .build()) - // .nistName("nist-name") - // .dinNotation("din-notation") - // .siName("si-name") - // .registrationAuthorityId("registration-authority-id") - // .siNotation("si-notation") - // .sourceOfDefinition("source-of-definition") - // .supplier("supplier") - // .unitName("unit-name") - // .unitSymbol("unit-symbol") - // .build()) .build()) .build(), "ConceptDescription-DataSpecificationPhysicalUnit.json"); From bfa69e37106c39452a671168a6e3d4357ec925f9 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 1 Feb 2024 11:01:51 +0100 Subject: [PATCH 84/91] Address the problem with the default QualifierKind --- .../dataformat/json/JsonDeserializerTest.java | 8 +++++ .../dataformat/json/JsonSerializerTest.java | 31 ++----------------- .../src/test/resources/Submodel-List.json | 2 ++ 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index d0e6d8b22..c588a2554 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -63,6 +63,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.json.JSONException; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; @@ -107,6 +108,13 @@ public void testReadReferable() throws IOException, DeserializationException { assertEquals(Examples.SUBMODEL.getModel(), submodel); } + @Test + public void testReadReference() throws IOException, DeserializationException { + Reference reference = Examples.EXAMPLE_FULL.getModel().getSubmodels().get(0).getSemanticId(); + Environment env = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); + assertEquals(reference, env.getSubmodels().get(0).getSemanticId()); + } + @Test public void testReadReferableFromStream() throws DeserializationException { Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 1299cfb8e..c41ccade5 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -41,6 +41,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; @@ -164,7 +165,7 @@ public void testSerializeSubmodel() throws IOException, SerializationException, @Test public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + compare(Examples.SUBMODEL_LIST_OF); } @Test @@ -172,18 +173,6 @@ public void testSerializeSubmodelElement() throws IOException, SerializationExce compare(Examples.SUBMODEL_ELEMENT); } - @Test - public void testSerializeSubmodelWithExtensions() throws DeserializationException { - List extensions = List.of( - new DefaultExtension.Builder() - .name("myExtension").value("my extension value").valueType(DataTypeDefXsd.STRING) - .build()); - JsonNode jsonNode = serializerToTest.toArrayNode(extensions); - Assert.assertTrue(jsonNode.isArray()); - List actual = new JsonDeserializer().readList(jsonNode, Extension.class); - assertEquals(extensions, actual); - } - @Test public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { compare(Examples.SUBMODEL_ELEMENT_LIST_OF); @@ -216,19 +205,6 @@ public void testSerializePropertyToNode() throws JSONException { validateAndCompare(expected.toPrettyString(), actual.toPrettyString()); } - @Test - public void testSerializeListOfReferablesToNode() throws DeserializationException { - List referables = List.of( - new DefaultProperty.Builder() - .idShort("exampleId") - .build()); - JsonNode node = serializerToTest.toArrayNode(referables); - Assert.assertNotNull(node); - Assert.assertTrue(node.isArray()); - List actual = new JsonDeserializer().readList(node, Referable.class); - assertEquals(referables, actual); - } - @Test public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { compare(Examples.EXTENSION_MINIMAL); @@ -241,10 +217,9 @@ public void testSerializeExtensionMaximal() throws SerializationException, JSONE @Test public void testSerializeReference() throws SerializationException, DeserializationException { - Reference reference = AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId(); + Reference reference = Examples.EXAMPLE_FULL.getModel().getSubmodels().get(0).getSemanticId(); String serializedReference = serializerToTest.write(reference); assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); - assertEquals(reference, new JsonDeserializer().read(serializedReference, Reference.class)); } @Test diff --git a/dataformat-json/src/test/resources/Submodel-List.json b/dataformat-json/src/test/resources/Submodel-List.json index a1708a819..1d9ea5cc6 100644 --- a/dataformat-json/src/test/resources/Submodel-List.json +++ b/dataformat-json/src/test/resources/Submodel-List.json @@ -46,11 +46,13 @@ "valueType": "xs:string", "qualifiers": [ { + "kind" : "ConceptQualifier", "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", "valueType": "xs:int" }, { + "kind" : "ConceptQualifier", "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", "valueType": "xs:int" From c3ecd3c415550ea1a22d7c8986aa6d111dde543a Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 1 Feb 2024 15:03:08 +0100 Subject: [PATCH 85/91] Remove partial data validation --- .../dataformat/json/JsonSerializerTest.java | 80 ++----------------- 1 file changed, 7 insertions(+), 73 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index c41ccade5..c75b5d1b2 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -33,25 +33,16 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Extension; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; import org.json.JSONException; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Rule; @@ -83,7 +74,7 @@ public void testSerializeNull() throws SerializationException { } @Test - public void testWriteToFile() throws IOException, SerializationException { + public void testSerializeToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); serializerToTest.write(new FileOutputStream(file), AASSimple.createEnvironment()); assertTrue(file.exists()); @@ -133,22 +124,22 @@ public void testSerializeCustomDataSpecification() throws SerializationException } @Test - public void testReadAssetAdministrationShellDescriptor() throws IOException, SerializationException, JSONException { + public void testSerializeShellDescriptor() throws IOException, SerializationException, JSONException { compare(Examples.SHELL_DESCRIPTOR); } @Test - public void testSerializeAAS() throws IOException, SerializationException, JSONException { + public void testSerializeShell() throws IOException, SerializationException, JSONException { compare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testSerializeAASWithAssetInformation() throws SerializationException, JSONException, IOException { + public void testSerializeShellWithAssetInformation() throws SerializationException, JSONException, IOException { compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); } @Test - public void testSerializeAASs() throws IOException, SerializationException, JSONException { + public void testSerializeShells() throws IOException, SerializationException, JSONException { compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @@ -164,7 +155,7 @@ public void testSerializeSubmodel() throws IOException, SerializationException, } @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodels() throws IOException, SerializationException, JSONException { compare(Examples.SUBMODEL_LIST_OF); } @@ -193,18 +184,6 @@ public void testSerializeSubmodelElementListEmpty() throws SerializationExceptio compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); } - @Test - public void testSerializePropertyToNode() throws JSONException { - Property property = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode expected = JsonNodeFactory.instance.objectNode(); - expected.put("idShort", "exampleId"); - expected.put("modelType", "Property"); - JsonNode actual = serializerToTest.toNode(property); - validateAndCompare(expected.toPrettyString(), actual.toPrettyString()); - } - @Test public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { compare(Examples.EXTENSION_MINIMAL); @@ -216,55 +195,10 @@ public void testSerializeExtensionMaximal() throws SerializationException, JSONE } @Test - public void testSerializeReference() throws SerializationException, DeserializationException { - Reference reference = Examples.EXAMPLE_FULL.getModel().getSubmodels().get(0).getSemanticId(); - String serializedReference = serializerToTest.write(reference); - assertTrue(serializedReference.contains("\"http://acplt.org/SubmodelTemplates/AssetIdentification\"")); - } - - @Test - public void testSerializeReferenceList() throws SerializationException { - List referenceList = AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels(); - String serializedReferenceArray = serializerToTest.write(referenceList); - assertTrue(serializedReferenceArray.contains("\"https://acplt.org/Test_Submodel\"")); - } - - @Test - public void testSerializeSpecificAssetId() throws SerializationException, JSONException, IOException { - SpecificAssetId specificAssetId = Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION - .getModel().getAssetInformation().getSpecificAssetIds().get(0); - - String jsonString = serializerToTest.write(specificAssetId); - assertTrue(jsonString.contains("\"name\"")); - assertTrue(jsonString.contains("\"value\"")); - - } - - - @Test - public void testSerializeSpecificAssetIdList() throws SerializationException, IOException { - List specificAssetIds = Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION - .getModel().getAssetInformation().getSpecificAssetIds(); - - String jsonString = serializerToTest.writeList(specificAssetIds); - assertTrue(jsonString.contains("\"name\"")); - assertTrue(jsonString.contains("\"value\"")); - assertTrue(jsonString.startsWith("[")); - assertTrue(jsonString.endsWith("]")); - } - - @Test - public void testReadSubmodelDescriptor() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelDescriptor() throws IOException, SerializationException, JSONException { compare(Examples.SUBMODEL_DESCRIPTOR); } - private void validateAndCompare(File expectedFile, SubmodelDescriptor descriptor) throws IOException, SerializationException, JSONException { - String expected = Files.readString(expectedFile.toPath()); - String actual = serializerToTest.write(descriptor); - validateAndCompare(expected, actual); - } - - @SuppressWarnings("unchecked") private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); From 4a21f7e1eb5fd799f6d98d40b32f40e33af2264e Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 1 Feb 2024 15:35:42 +0100 Subject: [PATCH 86/91] Add tests for OperationRequest --- .../dataformat/json/JsonDeserializerTest.java | 11 +-- .../dataformat/json/JsonSerializerTest.java | 95 +++++++++++-------- .../v3/dataformat/json/util/Examples.java | 26 +++++ .../src/test/resources/OperationRequest.json | 11 +++ 4 files changed, 93 insertions(+), 50 deletions(-) create mode 100644 dataformat-json/src/test/resources/OperationRequest.json diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index c588a2554..52d7ad6ae 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -332,14 +332,9 @@ public void testReadAasDescriptorsList() throws IOException, DeserializationExce } @Test - public void testDeserializeOperationRequest() throws DeserializationException, DatatypeConfigurationException, SerializationException { - OperationRequest expected = new DefaultOperationRequest.Builder() - .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes - .build(); - Duration duration = DatatypeFactory.newInstance().newDurationDayTime("P0DT0H3M0S"); // three minutes - String operationRequestString = new JsonSerializer().write(expected); - OperationRequest actual = deserializerToTest.read(operationRequestString, OperationRequest.class); - assertEquals( actual.getClientTimeoutDuration() , duration); + public void testDeserializeOperationRequest() throws DeserializationException, IOException { + OperationRequest expected = Examples.OPERATION_REQUEST.getModel(); + OperationRequest actual = deserializerToTest.read(Examples.OPERATION_REQUEST.fileContent(), OperationRequest.class); assertEquals(expected, actual); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index c75b5d1b2..a5c522b61 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -19,7 +19,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.nio.file.Files; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -27,7 +26,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; @@ -36,10 +34,6 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; - import com.fasterxml.jackson.databind.JsonNode; import org.json.JSONException; @@ -81,22 +75,22 @@ public void testSerializeToFile() throws IOException, SerializationException { } @Test - public void testSerializeEmpty() throws IOException, SerializationException, JSONException { + public void testSerializeEmpty() { validateAndCompare(Examples.ENVIRONMENT_EMPTY); } @Test - public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { + public void testSerializeSimpleExample() { validateAndCompare(Examples.EXAMPLE_SIMPLE); } @Test - public void testSerializeFullExample() throws SerializationException, JSONException, IOException { + public void testSerializeFullExample() { validateAndCompare(Examples.EXAMPLE_FULL); } @Test - public void testSerializeFullExampleToNode() throws JSONException, IOException { + public void testSerializeFullExampleToNode() throws IOException { String expected = Examples.EXAMPLE_FULL.fileContent(); JsonNode node = serializerToTest.toNode(Examples.EXAMPLE_FULL.getModel()); validateAndCompare(expected, node.toPrettyString()); @@ -116,7 +110,7 @@ public void testSerializeEmptyReferableList() throws SerializationException, JSO * @throws DeserializationException */ @Test - public void testSerializeCustomDataSpecification() throws SerializationException, IOException, JSONException { + public void testSerializeCustomDataSpecification() { // This is the only way to make the serialization to work. Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); subtypes.add(DefaultDummyDataSpecification.class); @@ -124,105 +118,122 @@ public void testSerializeCustomDataSpecification() throws SerializationException } @Test - public void testSerializeShellDescriptor() throws IOException, SerializationException, JSONException { + public void testSerializeShellDescriptor() { compare(Examples.SHELL_DESCRIPTOR); } @Test - public void testSerializeShell() throws IOException, SerializationException, JSONException { + public void testSerializeShell() { compare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testSerializeShellWithAssetInformation() throws SerializationException, JSONException, IOException { + public void testSerializeShellWithAssetInformation() { compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); } @Test - public void testSerializeShells() throws IOException, SerializationException, JSONException { + public void testSerializeShells() { compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @Test @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { + public void testSerializeConceptDescriptionWithPhysicalUnit() { compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodel() { compare(Examples.SUBMODEL); } @Test - public void testSerializeSubmodels() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodels() { compare(Examples.SUBMODEL_LIST_OF); } @Test - public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelElement() { compare(Examples.SUBMODEL_ELEMENT); } @Test - public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelElements() { compare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test - public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelElementCollection() { compare(Examples.SUBMODEL_ELEMENT_COLLECTION); } @Test - public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelElementList() { compare(Examples.SUBMODEL_ELEMENT_LIST); } @Test - public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { + public void testSerializeSubmodelElementListEmpty() { compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); } @Test - public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { + public void testSerializeExtensionMinimal() { compare(Examples.EXTENSION_MINIMAL); } @Test - public void testSerializeExtensionMaximal() throws SerializationException, JSONException, IOException { + public void testSerializeExtensionMaximal() { compare(Examples.EXTENSION_MAXIMAL); } @Test - public void testSerializeSubmodelDescriptor() throws IOException, SerializationException, JSONException { + public void testSerializeSubmodelDescriptor() { compare(Examples.SUBMODEL_DESCRIPTOR); } + @Test + public void testSerializeOperationRequest() { + compare(Examples.OPERATION_REQUEST); + } + @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual; - if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = serializerToTest.writeList((Collection) exampleData.getModel()); - } else { - actual = serializerToTest.write(exampleData.getModel()); + private void compare(ExampleData exampleData) { + try { + String expected = exampleData.fileContent(); + String actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = serializerToTest.writeList((Collection) exampleData.getModel()); + } else { + actual = serializerToTest.write(exampleData.getModel()); + } + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } catch(Exception ex) { + throw new RuntimeException(ex); } - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } - private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = serializerToTest.write(exampleData.getModel()); - validateAndCompare(expected, actual); + private void validateAndCompare(ExampleData exampleData) { + try { + String expected = exampleData.fileContent(); + String actual = serializerToTest.write(exampleData.getModel()); + validateAndCompare(expected, actual); + } catch (Exception ex) { + throw new RuntimeException(ex); + } } - private void validateAndCompare(String expected, String actual) throws JSONException { + private void validateAndCompare(String expected, String actual) { logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); assertTrue(errors.isEmpty()); - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + try { + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + } catch(JSONException ex) { + throw new RuntimeException(ex); + } } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 0fa6fb644..1462331a9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -23,12 +23,14 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; @@ -51,6 +53,9 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; @@ -59,6 +64,8 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; import java.util.List; public class Examples { @@ -172,6 +179,22 @@ private static SubmodelDescriptor createDefaultSubmodelDescriptor () { .semanticId(DEFAULT_SEMANTIC_ID) .build(); } + + private static OperationRequest createOperationRequest() { + try { + return new DefaultOperationRequest.Builder() + .inoutputArguments(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .valueType(DataTypeDefXsd.INT).value("42") + .idShort("TheAnswerOfAllQuestions") + .build()) + .build()) + .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes + .build(); + } catch (DatatypeConfigurationException e) { + throw new RuntimeException(e); + } + } public static final ExampleData EXAMPLE_FULL = ExampleData.of(AASFull.createEnvironment(), "Example-Full.json"); public static final ExampleData EXAMPLE_SIMPLE = ExampleData.of(AASSimple.createEnvironment(), "Example-Simple.json"); @@ -265,4 +288,7 @@ private static SubmodelDescriptor createDefaultSubmodelDescriptor () { public static final ExampleData EXTENSION_MINIMAL = ExampleData.of(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.EXTENSION_MINIMAL, "admin-shell-io/Extension/Minimal.json"); public static final ExampleData EXTENSION_MAXIMAL = ExampleData.of(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.EXTENSION_MAXIMAL, "admin-shell-io/Extension/Maximal.json"); + + public static final ExampleData OPERATION_REQUEST = ExampleData.of( + createOperationRequest(), "OperationRequest.json"); } diff --git a/dataformat-json/src/test/resources/OperationRequest.json b/dataformat-json/src/test/resources/OperationRequest.json new file mode 100644 index 000000000..9313e08ae --- /dev/null +++ b/dataformat-json/src/test/resources/OperationRequest.json @@ -0,0 +1,11 @@ +{ + "clientTimeoutDuration" : "PT3M", + "inoutputArguments" : [ { + "value" : { + "modelType" : "Property", + "value" : "42", + "valueType" : "xs:int", + "idShort" : "TheAnswerOfAllQuestions" + } + } ] +} \ No newline at end of file From ddad0bae423b1fdc9fea0121aa92fd3f9b7ce1f8 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Thu, 1 Feb 2024 16:19:41 +0100 Subject: [PATCH 87/91] Refactoring of the tests --- .../dataformat/json/JsonDeserializerTest.java | 108 +++--------------- .../dataformat/json/JsonSerializerTest.java | 108 +++++++++--------- 2 files changed, 72 insertions(+), 144 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 52d7ad6ae..bcef3f1a5 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -15,27 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.util.Collections; import java.util.List; import java.util.Set; -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; - import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; @@ -50,27 +40,20 @@ import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.json.JSONException; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; public class JsonDeserializerTest { private static JsonDeserializer deserializerToTest; @@ -108,13 +91,6 @@ public void testReadReferable() throws IOException, DeserializationException { assertEquals(Examples.SUBMODEL.getModel(), submodel); } - @Test - public void testReadReference() throws IOException, DeserializationException { - Reference reference = Examples.EXAMPLE_FULL.getModel().getSubmodels().get(0).getSemanticId(); - Environment env = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); - assertEquals(reference, env.getSubmodels().get(0).getSemanticId()); - } - @Test public void testReadReferableFromStream() throws DeserializationException { Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); @@ -162,21 +138,21 @@ public void testReadReferablesFromStreamUsingUtf8Charset() throws Exception { } @Test - public void testSimpleExample() throws Exception { + public void testReadSimpleExampleEnv() throws Exception { Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); Environment actual = deserializerToTest.read(Examples.EXAMPLE_SIMPLE.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @Test - public void testFullExample() throws Exception { + public void testReadFullExampleEnv() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); Environment actual = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); Assert.assertEquals(expected, actual); } @Test - public void testFullExampleFromNode() throws Exception { + public void testReadFullExampleEnvFromNode() throws Exception { Environment expected = Examples.EXAMPLE_FULL.getModel(); JsonNode node = new ObjectMapper().readTree(Examples.EXAMPLE_FULL.fileContentStream()); Environment actual = deserializerToTest.read(node, Environment.class); @@ -184,8 +160,9 @@ public void testFullExampleFromNode() throws Exception { } @Test - public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.createEnvironment()); + public void testReadCustomImplementationClass() throws Exception { + String json = Examples.EXAMPLE_SIMPLE.fileContent(); + // As we test useImplementation(), we need to create a new deserializer here. JsonDeserializer deserializer = new JsonDeserializer(); Environment environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); @@ -199,14 +176,14 @@ public void testCustomImplementationClass() throws Exception { } @Test - public void testReadAAS() throws DeserializationException { + public void testReadShell() throws DeserializationException { AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); AssetAdministrationShell actual = deserializerToTest.read(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); } @Test - public void testReadAASs() throws DeserializationException { + public void testReadShells() throws DeserializationException { List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); List actual = deserializerToTest.readList(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); assertEquals(expected, actual); @@ -279,7 +256,7 @@ public void testReadEmptyReferableList() throws DeserializationException { @Test @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") - public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { + public void testReadConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { ConceptDescription expected = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.getModel(); ConceptDescription actual = deserializerToTest.read( Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.fileContentStream(), @@ -287,28 +264,15 @@ public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOExcepti assertEquals(expected, actual); } - - @Test - public void testPropertyFromNode() throws Exception { - Property expected = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode node = JsonNodeFactory.instance.objectNode(); - node.put("idShort", "exampleId"); - node.put("modelType", "Property"); - Property actual = deserializerToTest.read(node, Property.class); - assertEquals(expected, actual); - } - @Test - public void testExtensionMinimal() throws Exception { + public void testReadExtensionMinimalEnv() throws Exception { Environment expected = Examples.EXTENSION_MINIMAL.getModel(); Environment actual = deserializerToTest.read(Examples.EXTENSION_MINIMAL.fileContentStream(), Environment.class); assertEquals(expected, actual); } @Test - public void testExtensionMaximal() throws Exception { + public void testReadExtensionMaximalEnv() throws Exception { Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); Environment actual = deserializerToTest.read(Examples.EXTENSION_MAXIMAL.fileContentStream(), Environment.class); assertEquals(expected, actual); @@ -317,14 +281,14 @@ public void testExtensionMaximal() throws Exception { @Test - public void testReadAasDescriptor() throws IOException, DeserializationException { + public void testReadShellDescriptor() throws IOException, DeserializationException { AssetAdministrationShellDescriptor shellDescriptor = deserializerToTest.read(Examples.SHELL_DESCRIPTOR.fileContent(), AssetAdministrationShellDescriptor.class); assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptor); } @Test - public void testReadAasDescriptorsList() throws IOException, DeserializationException { + public void testReadShellDescriptors() throws IOException, DeserializationException { String jsonString = "[" + Examples.SHELL_DESCRIPTOR.fileContent() + "]"; List shellDescriptors = deserializerToTest.readList(jsonString, AssetAdministrationShellDescriptor.class); @@ -332,52 +296,12 @@ public void testReadAasDescriptorsList() throws IOException, DeserializationExce } @Test - public void testDeserializeOperationRequest() throws DeserializationException, IOException { + public void testReadOperationRequest() throws DeserializationException, IOException { OperationRequest expected = Examples.OPERATION_REQUEST.getModel(); OperationRequest actual = deserializerToTest.read(Examples.OPERATION_REQUEST.fileContent(), OperationRequest.class); assertEquals(expected, actual); } - @Test - public void testDeserializeReference() throws DeserializationException, SerializationException { - String jsonReference = new JsonSerializer().write(AASFull.ENVIRONMENT.getSubmodels().get(0).getSemanticId()); - Reference reference = deserializerToTest.read(jsonReference, Reference.class); - assertTrue(!reference.getKeys().get(0).getValue().isEmpty()); - } - - @Test - public void testDeserializeReferenceList() throws DeserializationException, SerializationException { - String jsonReferenceList = new JsonSerializer().writeList(AASFull.ENVIRONMENT.getAssetAdministrationShells().get(0).getSubmodels()); - List referenceList = deserializerToTest.readList(jsonReferenceList, Reference.class); - assertTrue(referenceList.get(0).getType().equals(ReferenceTypes.EXTERNAL_REFERENCE)); - } - - @Test - public void testDeserializeSpecificAssetId() throws DeserializationException, SerializationException { - SpecificAssetId expected = new DefaultSpecificAssetId.Builder() - .name("testSpecificAssetId") - .value("testValue") - .build(); - - String specificAssetIdString = new JsonSerializer().write(expected); - assertEquals(expected, deserializerToTest.read(specificAssetIdString, SpecificAssetId.class)); - } - - @Test - public void testDeserializeSpecificAssetIdList() throws DeserializationException, SerializationException { - JsonSerializer serializer = new JsonSerializer(); - - SpecificAssetId expected = new DefaultSpecificAssetId.Builder() - .name("testSpecificAssetId") - .value("testValue") - .build(); - - String specificAssetId_list_string = serializer.writeList(List.of(expected)); - List specificAssetIdList = deserializerToTest.readList( - specificAssetId_list_string, SpecificAssetId.class); - assertEquals(expected, specificAssetIdList.get(0)); - } - @Test public void testReadSubmodelDescriptor() throws IOException, DeserializationException { SubmodelDescriptor submodelDescriptor = deserializerToTest.read( @@ -402,6 +326,4 @@ private void checkImplementationClasses(Environment environment, .forEach(element -> assertEquals(element.getClass(), propertyImpl)); }); } - - -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index a5c522b61..4b54bc998 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -63,43 +63,43 @@ public static void initialize() { public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testSerializeNull() throws SerializationException { + public void testWriteNull() throws SerializationException { assertEquals("null", serializerToTest.write(null)); } @Test - public void testSerializeToFile() throws IOException, SerializationException { + public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); serializerToTest.write(new FileOutputStream(file), AASSimple.createEnvironment()); assertTrue(file.exists()); } @Test - public void testSerializeEmpty() { - validateAndCompare(Examples.ENVIRONMENT_EMPTY); + public void testWriteEmptyEnv() { + writeValidateAndCompare(Examples.ENVIRONMENT_EMPTY); } @Test - public void testSerializeSimpleExample() { - validateAndCompare(Examples.EXAMPLE_SIMPLE); + public void testWriteSimpleExampleEnv() { + writeValidateAndCompare(Examples.EXAMPLE_SIMPLE); } @Test - public void testSerializeFullExample() { - validateAndCompare(Examples.EXAMPLE_FULL); + public void testWriteFullExampleEnv() { + writeValidateAndCompare(Examples.EXAMPLE_FULL); } @Test - public void testSerializeFullExampleToNode() throws IOException { + public void testFullExampleEnvToNode() throws IOException { String expected = Examples.EXAMPLE_FULL.fileContent(); JsonNode node = serializerToTest.toNode(Examples.EXAMPLE_FULL.getModel()); validateAndCompare(expected, node.toPrettyString()); } @Test - public void testSerializeEmptyReferableList() throws SerializationException, JSONException { + public void testWriteEmptyReferableList() throws SerializationException, JSONException { List emptyList = Collections.emptyList(); - String actual = serializerToTest.write(emptyList); + String actual = serializerToTest.writeList(emptyList); JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); } @@ -110,104 +110,110 @@ public void testSerializeEmptyReferableList() throws SerializationException, JSO * @throws DeserializationException */ @Test - public void testSerializeCustomDataSpecification() { + public void testWriteCustomDataSpecification() { // This is the only way to make the serialization to work. Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); subtypes.add(DefaultDummyDataSpecification.class); - compare(Examples.ENVIRONMENT_CUSTOM_DATA); + writeAndCompare(Examples.ENVIRONMENT_CUSTOM_DATA); } @Test - public void testSerializeShellDescriptor() { - compare(Examples.SHELL_DESCRIPTOR); + public void testWriteShellDescriptor() { + writeAndCompare(Examples.SHELL_DESCRIPTOR); } @Test - public void testSerializeShell() { - compare(Examples.ASSET_ADMINISTRATION_SHELL); + public void testWriteShell() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testSerializeShellWithAssetInformation() { - compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); + public void testWriteShellWithAssetInformation() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); } @Test - public void testSerializeShells() { - compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + public void testWriteShells() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @Test @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() { - compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); + public void testWriteConceptDescriptionWithPhysicalUnit() { + writeAndCompare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); } @Test - public void testSerializeSubmodel() { - compare(Examples.SUBMODEL); + public void testWriteSubmodel() { + writeAndCompare(Examples.SUBMODEL); } @Test - public void testSerializeSubmodels() { - compare(Examples.SUBMODEL_LIST_OF); + public void testWriteSubmodels() { + writeAndCompare(Examples.SUBMODEL_LIST_OF); } @Test - public void testSerializeSubmodelElement() { - compare(Examples.SUBMODEL_ELEMENT); + public void testWriteSubmodelElement() { + writeAndCompare(Examples.SUBMODEL_ELEMENT); } @Test - public void testSerializeSubmodelElements() { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); + public void testWriteSubmodelElements() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test - public void testSerializeSubmodelElementCollection() { - compare(Examples.SUBMODEL_ELEMENT_COLLECTION); + public void testWriteSubmodelElementCollection() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_COLLECTION); } @Test - public void testSerializeSubmodelElementList() { - compare(Examples.SUBMODEL_ELEMENT_LIST); + public void testWriteSubmodelElementList() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST); } @Test - public void testSerializeSubmodelElementListEmpty() { - compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); + public void testWriteSubmodelElementListEmpty() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); } @Test - public void testSerializeExtensionMinimal() { - compare(Examples.EXTENSION_MINIMAL); + public void testWriteExtensionMinimal() { + writeAndCompare(Examples.EXTENSION_MINIMAL); } @Test - public void testSerializeExtensionMaximal() { - compare(Examples.EXTENSION_MAXIMAL); + public void testWriteExtensionMaximal() { + writeAndCompare(Examples.EXTENSION_MAXIMAL); } @Test - public void testSerializeSubmodelDescriptor() { - compare(Examples.SUBMODEL_DESCRIPTOR); + public void testWriteSubmodelDescriptor() { + writeAndCompare(Examples.SUBMODEL_DESCRIPTOR); } @Test - public void testSerializeOperationRequest() { - compare(Examples.OPERATION_REQUEST); + public void testWriteOperationRequest() { + writeAndCompare(Examples.OPERATION_REQUEST); } - @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) { - try { - String expected = exampleData.fileContent(); + private String write(ExampleData exampleData) throws SerializationException { String actual; if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { actual = serializerToTest.writeList((Collection) exampleData.getModel()); } else { actual = serializerToTest.write(exampleData.getModel()); } + return actual; + } + + @SuppressWarnings("unchecked") + private void writeAndCompare(ExampleData exampleData) { + try { + String actual = write(exampleData); + String expected = exampleData.fileContent(); + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } catch(Exception ex) { @@ -215,10 +221,10 @@ private void compare(ExampleData exampleData) { } } - private void validateAndCompare(ExampleData exampleData) { + private void writeValidateAndCompare(ExampleData exampleData) { try { + String actual = write(exampleData); String expected = exampleData.fileContent(); - String actual = serializerToTest.write(exampleData.getModel()); validateAndCompare(expected, actual); } catch (Exception ex) { throw new RuntimeException(ex); From c55601f3f6bce834892c9048aa5aa2fe95a46ced Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 2 Feb 2024 09:49:08 +0100 Subject: [PATCH 88/91] Refactoring of the tests --- .../v3/dataformat/json/JsonSerializer.java | 66 ++++++++++++----- .../dataformat/json/JsonDeserializerTest.java | 17 +++++ .../dataformat/json/JsonSerializerTest.java | 73 ++++++++++++++----- .../v3/dataformat/json/util/ExampleData.java | 12 +++ 4 files changed, 132 insertions(+), 36 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 3b3892759..527468176 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -58,6 +58,26 @@ public String write(Object aasInstance) throws SerializationException { } } + /** + * Generic method to serialize a collection. + * @param collection the collection to serialize. Not null. + * @return the string representation of the collection. + * @throws SerializationException if serialization fails + */ + public String writeList(Collection collection) throws SerializationException { + if (collection == null || collection.isEmpty()) { + return write(collection); + } + + Class clazz = collection.iterator().next().getClass(); + try { + return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) + .writeValueAsString(collection); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); + } + } + /** * Generic method to convert a given AAS instance to a JSON node * @@ -76,9 +96,9 @@ public JsonNode toNode(Object aasInstance) { * @return the JSON array representation * @throws IllegalArgumentException */ - public ArrayNode toArrayNode(Collection aasInstances) { + public JsonNode toArrayNode(Collection aasInstances) { if(aasInstances == null) { - return null; + return JsonNodeFactory.instance.nullNode(); } ArrayNode result = JsonNodeFactory.instance.arrayNode(); for (Object obj : aasInstances) { @@ -95,7 +115,7 @@ public ArrayNode toArrayNode(Collection aasInstances) { * @param aasInstance the AAS instance to serialize * @throws SerializationException if serialization fails */ - void write(OutputStream out, Charset charset, Object aasInstance) throws SerializationException { + public void write(OutputStream out, Charset charset, Object aasInstance) throws SerializationException { try { mapper.writeValue(new OutputStreamWriter(out, charset), aasInstance); } catch (IOException ex) { @@ -103,7 +123,6 @@ void write(OutputStream out, Charset charset, Object aasInstance) throws Seriali } } - /** * Generic method to serialize a given AAS instance to an output stream using UTF-8 charset * @@ -111,31 +130,40 @@ void write(OutputStream out, Charset charset, Object aasInstance) throws Seriali * @param aasInstance the AAS instance to serialize * @throws SerializationException if serialization fails */ - void write(OutputStream out, Object aasInstance) throws SerializationException { + public void write(OutputStream out, Object aasInstance) throws SerializationException { write(out, StandardCharsets.UTF_8, aasInstance); } /** - * Generic method to serialize a collection. - * @param collection the collection to serialize - * @return the string representation of the collection. + * Generic method to serialize a collection of AAS instances to an output stream using given charset + * + * @param out the output stream to serialize to + * @param charset the charset to use for serialization + * @param collection the collection of AAS instances to serialize * @throws SerializationException if serialization fails */ - public String writeList(Collection collection) throws SerializationException { + public void writeList(OutputStream out, Charset charset, Collection collection) throws SerializationException { if (collection == null || collection.isEmpty()) { + write(out, charset, collection); + } else { + Class clazz = collection.iterator().next().getClass(); try { - return mapper.writeValueAsString(collection); - } catch (JsonProcessingException e) { - throw new SerializationException("error serializing list"); + mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) + .writeValue(new OutputStreamWriter(out, charset), collection); + } catch (IOException ex) { + throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); } } + } - Class clazz = collection.iterator().next().getClass(); - try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) - .writeValueAsString(collection); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); - } + /** + * Generic method to serialize a collection of AAS instances to an output stream using UTF-8 charset + * + * @param out the output stream to serialize to + * @param collection the collection of AAS instances to serialize + * @throws SerializationException if serialization fails + */ + public void writeList(OutputStream out, Collection collection) throws SerializationException { + writeList(out, StandardCharsets.UTF_8, collection); } } \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index bcef3f1a5..d4f4351bf 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; @@ -30,6 +31,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; @@ -297,6 +299,7 @@ public void testReadShellDescriptors() throws IOException, DeserializationExcept @Test public void testReadOperationRequest() throws DeserializationException, IOException { + readAndCompare(Examples.OPERATION_REQUEST); OperationRequest expected = Examples.OPERATION_REQUEST.getModel(); OperationRequest actual = deserializerToTest.read(Examples.OPERATION_REQUEST.fileContent(), OperationRequest.class); assertEquals(expected, actual); @@ -309,6 +312,7 @@ public void testReadSubmodelDescriptor() throws IOException, DeserializationExce assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptor); } + @Test public void testReadSubmodelDescriptors() throws IOException, DeserializationException { String jsonString = "[" + Examples.SUBMODEL_DESCRIPTOR.fileContent() + "]"; @@ -317,6 +321,19 @@ public void testReadSubmodelDescriptors() throws IOException, DeserializationExc assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptors.get(0)); } + private void readAndCompare(ExampleData exampleData) throws IOException, DeserializationException { + assertEquals(exampleData.getModel(), readFromString(exampleData)); + } + + private Object readFromString(ExampleData exampleData) throws IOException, DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.fileContent(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.fileContent(), model.getClass()); + } + private void checkImplementationClasses(Environment environment, Class submodelImpl, Class propertyImpl) { environment.getSubmodels().forEach(submodel -> { diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 4b54bc998..02544eb24 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -16,17 +16,19 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; @@ -47,7 +49,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertEquals;; import static org.junit.Assert.assertTrue; public class JsonSerializerTest { @@ -65,12 +67,24 @@ public static void initialize() { @Test public void testWriteNull() throws SerializationException { assertEquals("null", serializerToTest.write(null)); + assertEquals("null", serializerToTest.writeList(null)); + + assertEquals(JsonNodeFactory.instance.nullNode(), serializerToTest.toNode(null)); + assertEquals(JsonNodeFactory.instance.nullNode(), serializerToTest.toArrayNode(null)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + serializerToTest.write(baos, StandardCharsets.UTF_8, null); + assertEquals("null", baos.toString()); + + baos = new ByteArrayOutputStream(); + serializerToTest.writeList(baos,null); + assertEquals("null", baos.toString()); } + // This test is used only to show how to write to a file. @Test public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); - serializerToTest.write(new FileOutputStream(file), AASSimple.createEnvironment()); + serializerToTest.write(new FileOutputStream(file), Examples.EXAMPLE_SIMPLE.getModel()); assertTrue(file.exists()); } @@ -199,23 +213,47 @@ public void testWriteOperationRequest() { } private String write(ExampleData exampleData) throws SerializationException { - String actual; - if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = serializerToTest.writeList((Collection) exampleData.getModel()); - } else { - actual = serializerToTest.write(exampleData.getModel()); - } - return actual; + String actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = serializerToTest.writeList((Collection) exampleData.getModel()); + } else { + actual = serializerToTest.write(exampleData.getModel()); + } + return actual; + } + + private String writeViaStream(ExampleData exampleData) throws SerializationException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + serializerToTest.writeList(baos, StandardCharsets.UTF_8, (Collection) exampleData.getModel()); + } else { + serializerToTest.write(baos, StandardCharsets.UTF_8, exampleData.getModel()); + } + return baos.toString(StandardCharsets.UTF_8); + } + + private JsonNode toNode(ExampleData exampleData) { + JsonNode actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = serializerToTest.toArrayNode((Collection) exampleData.getModel()); + } else { + actual = serializerToTest.toNode(exampleData.getModel()); + } + return actual; + } + + private void compare(String expected, String actual) throws JSONException { + JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); + JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } @SuppressWarnings("unchecked") private void writeAndCompare(ExampleData exampleData) { try { - String actual = write(exampleData); String expected = exampleData.fileContent(); - - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + compare(expected, write(exampleData)); + assertEquals(exampleData.getJsonNode() , toNode(exampleData)); + compare(expected, writeViaStream(exampleData)); } catch(Exception ex) { throw new RuntimeException(ex); } @@ -232,12 +270,13 @@ private void writeValidateAndCompare(ExampleData exampleData) { } private void validateAndCompare(String expected, String actual) { - logger.info(actual); Set errors = new JsonSchemaValidator().validateSchema(actual); + if(errors.size() > 0) { + logger.error(String.join("\n", errors)); + } assertTrue(errors.isEmpty()); try { - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); + compare(expected, actual); } catch(JSONException ex) { throw new RuntimeException(ex); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java index 82cd21dc5..3acd6508b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java @@ -15,12 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; public class ExampleData { + private static final ObjectMapper mapper = new ObjectMapper(); + private final T model; private final String file; @@ -49,4 +54,11 @@ public InputStream fileContentStream() { return getClass().getClassLoader().getResourceAsStream(file); } + public JsonNode getJsonNode() { + try { + return mapper.readTree(fileContent()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } From fa2f191fb1e174b29fb3877a35aa9a7991a54857 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 2 Feb 2024 10:36:22 +0100 Subject: [PATCH 89/91] Refactoring of the tests --- .../v3/dataformat/json/JsonDeserializer.java | 72 +++--- .../dataformat/json/JsonDeserializerTest.java | 231 +++++------------- 2 files changed, 101 insertions(+), 202 deletions(-) diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 1f37cbdf3..785769cd9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -79,20 +79,19 @@ public T read(String value, Class valueType) throws DeserializationExcept } /** - * Generic method to deserialize a given JSON node into instance of an AAS type + * Generic method to deserialize a given string into a list of AAS instances * - * @param node the node to parse - * @param valueType the class type of the AAS instance. Not null. + * @param value a string representation of the AAS instances list + * @param valueType the class type of the instance. Not null. * @param the AAS type - * @return an AAS instance - * + * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public T read(JsonNode node, Class valueType) throws DeserializationException { + public List readList(String value, Class valueType) throws DeserializationException { try { - return mapper.treeToValue(node, valueType); + return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } @@ -128,67 +127,68 @@ public T read(InputStream stream, Charset charset, Class valueType) throw } /** - * Generic method to deserialize a given string into a list of AAS instances + * Deserializes a given input stream into a list of AAS instances using the default UTF-8 charset * - * @param value a string representation of the AAS instances list - * @param valueType the class type of the instance. Not null. + * @param stream An InputStream containing the string representation of the AAS instances list + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public List readList(String value, Class valueType) throws DeserializationException { - try { - return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); - } + public List readList(InputStream stream, Class valueType) throws DeserializationException { + return readList(stream, StandardCharsets.UTF_8, valueType); } /** - * Deserializes a given JsonArray into a list of AAS instances + * Deserializes a given input stream into a list of AAS instances * - * @param node a JsonArray representing the AAS instances list - * @param valueType the class type of the instance. Not null. + * @param stream An InputStream containing the string representation of the AAS instances list + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public List readList(JsonNode node, Class valueType) throws DeserializationException { + public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { try { - return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (JsonProcessingException ex) { + return mapper.readValue(new InputStreamReader(stream, charset), + mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (Exception ex) { throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given input stream into a list of AAS instances using the default UTF-8 charset + * Generic method to deserialize a given JSON node into instance of an AAS type * - * @param stream An InputStream containing the string representation of the AAS instances list + * @param node the node to parse * @param valueType the class type of the AAS instance. Not null. * @param the AAS type - * @return a list of AAS instances + * @return an AAS instance + * * @throws DeserializationException if deserialization fails */ - public List readList(InputStream stream, Class valueType) throws DeserializationException { - return readList(stream, StandardCharsets.UTF_8, valueType); + public T read(JsonNode node, Class valueType) throws DeserializationException { + try { + return mapper.treeToValue(node, valueType); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given input stream into a list of AAS instances + * Deserializes a given JsonArray into a list of AAS instances * - * @param stream An InputStream containing the string representation of the AAS instances list - * @param charset the charset to use for deserialization - * @param valueType the class type of the AAS instance. Not null. + * @param node a JsonArray representing the AAS instances list + * @param valueType the class type of the instance. Not null. * @param the AAS type * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + public List readList(JsonNode node, Class valueType) throws DeserializationException { try { - return mapper.readValue(new InputStreamReader(stream, charset), - mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); - } catch (Exception ex) { + return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (JsonProcessingException ex) { throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index d4f4351bf..3bfe98b46 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -16,15 +16,11 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; @@ -33,24 +29,18 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.Property; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -65,12 +55,6 @@ public static void initialize() { deserializerToTest = new JsonDeserializer(); } - @Test - public void testReadEnvironmentFromStream() throws DeserializationException { - Environment env = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); - assertEquals(Examples.EXAMPLE_FULL.getModel(), env); - } - /** * This test ensures that future DataSpecificationContents can be added without adjustments in the code. * @@ -87,80 +71,6 @@ public void testReadCustomDataSpecification() throws DeserializationException { assertEquals(Examples.ENVIRONMENT_CUSTOM_DATA.getModel(), env); } - @Test - public void testReadReferable() throws IOException, DeserializationException { - Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContent(), Submodel.class); - assertEquals(Examples.SUBMODEL.getModel(), submodel); - } - - @Test - public void testReadReferableFromStream() throws DeserializationException { - Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(Examples.SUBMODEL.getModel(), submodel); - } - - @Test - public void testReadReferableFromNode() throws Exception { - JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL.fileContentStream()); - Submodel submodel = deserializerToTest.read(node, Submodel.class); - assertEquals(Examples.SUBMODEL.getModel(), submodel); - } - - @Test - public void testReadReferableFromStreamUsingCharset() throws Exception { - Submodel submodel = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(Examples.SUBMODEL.getModel(), submodel); - } - - @Test - public void testReadReferables() throws Exception { - List submodels = deserializerToTest.readList(Examples.SUBMODEL_LIST_OF.fileContent(), Submodel.class); - assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); - } - - @Test - public void testReadReferablesFromNode() throws Exception { - JsonNode node = new ObjectMapper().readTree(Examples.SUBMODEL_LIST_OF.fileContentStream()); - List submodels = deserializerToTest.readList(node, Submodel.class); - assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); - } - - @Test - public void testReadReferablesFromStream() throws Exception { - List submodels = deserializerToTest.readList( - Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); - } - - @Test - public void testReadReferablesFromStreamUsingUtf8Charset() throws Exception { - List submodels = deserializerToTest.readList( - Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(Examples.SUBMODEL_LIST_OF.getModel(), submodels); - } - - @Test - public void testReadSimpleExampleEnv() throws Exception { - Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = deserializerToTest.read(Examples.EXAMPLE_SIMPLE.fileContentStream(), Environment.class); - Assert.assertEquals(expected, actual); - } - - @Test - public void testReadFullExampleEnv() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = deserializerToTest.read(Examples.EXAMPLE_FULL.fileContentStream(), Environment.class); - Assert.assertEquals(expected, actual); - } - - @Test - public void testReadFullExampleEnvFromNode() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - JsonNode node = new ObjectMapper().readTree(Examples.EXAMPLE_FULL.fileContentStream()); - Environment actual = deserializerToTest.read(node, Environment.class); - Assert.assertEquals(expected, actual); - } - @Test public void testReadCustomImplementationClass() throws Exception { String json = Examples.EXAMPLE_SIMPLE.fileContent(); @@ -178,115 +88,85 @@ public void testReadCustomImplementationClass() throws Exception { } @Test - public void testReadShell() throws DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = deserializerToTest.read(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); + @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") + public void testReadConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { + ConceptDescription expected = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.getModel(); + ConceptDescription actual = deserializerToTest.read( + Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.fileContentStream(), + ConceptDescription.class); assertEquals(expected, actual); } @Test - public void testReadShells() throws DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = deserializerToTest.readList(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + List deserialized = deserializerToTest.readList("[]", Referable.class); + assertEquals(emptyList, deserialized); } @Test - public void testReadSubmodelUsingUtf8Charset() throws DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); + public void testReadFullExampleEnv() { + readAndCompare(Examples.EXAMPLE_FULL); } @Test - public void testReadSubmodelsFromStreamUsingUtf8Charset() throws DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = deserializerToTest.readList( - Examples.SUBMODEL_LIST_OF.fileContentStream(), StandardCharsets.UTF_8, Submodel.class); - assertEquals(expected, actual); + public void testReadSimpleExampleEnv() { + readAndCompare(Examples.EXAMPLE_SIMPLE); } @Test - public void testReadSubmodel() throws DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = deserializerToTest.read(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + public void testReadShell() { + readAndCompare(Examples.ASSET_ADMINISTRATION_SHELL); } @Test - public void testReadSubmodels() throws DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = deserializerToTest.readList(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); + public void testReadShells() { + readAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); } @Test - public void testReadSubmodelElement() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + public void testReadSubmodel() { + readAndCompare(Examples.SUBMODEL); } @Test - public void testReadSubmodelElements() throws DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = deserializerToTest.readList( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); + public void testReadSubmodels() { + readAndCompare(Examples.SUBMODEL_LIST_OF); } @Test - public void testReadSubmodelElementList() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); + public void testReadSubmodelElement() { + readAndCompare(Examples.SUBMODEL_ELEMENT); } @Test - public void testReadSubmodelElementCollection() throws DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = deserializerToTest.read(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); + public void testReadSubmodelElements() { + readAndCompare(Examples.SUBMODEL_ELEMENT_LIST_OF); } @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = deserializerToTest.readList("[]", Referable.class); - assertEquals(emptyList, deserialized); + public void testReadSubmodelElementList() { + readAndCompare(Examples.SUBMODEL_ELEMENT_LIST); } @Test - @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") - public void testReadConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { - ConceptDescription expected = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.getModel(); - ConceptDescription actual = deserializerToTest.read( - Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.fileContentStream(), - ConceptDescription.class); - assertEquals(expected, actual); + public void testReadSubmodelElementCollection() { + readAndCompare(Examples.SUBMODEL_ELEMENT_COLLECTION); } @Test - public void testReadExtensionMinimalEnv() throws Exception { - Environment expected = Examples.EXTENSION_MINIMAL.getModel(); - Environment actual = deserializerToTest.read(Examples.EXTENSION_MINIMAL.fileContentStream(), Environment.class); - assertEquals(expected, actual); + public void testReadExtensionMinimalEnv() { + readAndCompare(Examples.EXTENSION_MINIMAL); } @Test public void testReadExtensionMaximalEnv() throws Exception { - Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); - Environment actual = deserializerToTest.read(Examples.EXTENSION_MAXIMAL.fileContentStream(), Environment.class); - assertEquals(expected, actual); + readAndCompare(Examples.EXTENSION_MAXIMAL); } - - @Test - public void testReadShellDescriptor() throws IOException, DeserializationException { - AssetAdministrationShellDescriptor shellDescriptor = - deserializerToTest.read(Examples.SHELL_DESCRIPTOR.fileContent(), AssetAdministrationShellDescriptor.class); - assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptor); + public void testReadShellDescriptor() { + readAndCompare(Examples.SHELL_DESCRIPTOR); } @Test @@ -298,21 +178,15 @@ public void testReadShellDescriptors() throws IOException, DeserializationExcept } @Test - public void testReadOperationRequest() throws DeserializationException, IOException { + public void testReadOperationRequest() { readAndCompare(Examples.OPERATION_REQUEST); - OperationRequest expected = Examples.OPERATION_REQUEST.getModel(); - OperationRequest actual = deserializerToTest.read(Examples.OPERATION_REQUEST.fileContent(), OperationRequest.class); - assertEquals(expected, actual); } @Test - public void testReadSubmodelDescriptor() throws IOException, DeserializationException { - SubmodelDescriptor submodelDescriptor = deserializerToTest.read( - Examples.SUBMODEL_DESCRIPTOR.fileContentStream(), SubmodelDescriptor.class); - assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptor); + public void testReadSubmodelDescriptor() { + readAndCompare(Examples.SUBMODEL_DESCRIPTOR); } - @Test public void testReadSubmodelDescriptors() throws IOException, DeserializationException { String jsonString = "[" + Examples.SUBMODEL_DESCRIPTOR.fileContent() + "]"; @@ -321,8 +195,15 @@ public void testReadSubmodelDescriptors() throws IOException, DeserializationExc assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptors.get(0)); } - private void readAndCompare(ExampleData exampleData) throws IOException, DeserializationException { - assertEquals(exampleData.getModel(), readFromString(exampleData)); + private void readAndCompare(ExampleData exampleData) { + try { + Object expected = exampleData.getModel(); + assertEquals(expected, readFromString(exampleData)); + assertEquals(expected, readFromNode(exampleData)); + assertEquals(expected, readFromStream(exampleData)); + } catch (Exception ex) { + throw new RuntimeException(ex); + } } private Object readFromString(ExampleData exampleData) throws IOException, DeserializationException { @@ -334,6 +215,24 @@ private Object readFromString(ExampleData exampleData) throws IOException, De return deserializerToTest.read(exampleData.fileContent(), model.getClass()); } + private Object readFromStream(ExampleData exampleData) throws DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.fileContentStream(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.fileContentStream(), model.getClass()); + } + + private Object readFromNode(ExampleData exampleData) throws IOException, DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.getJsonNode(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.getJsonNode(), model.getClass()); + } + private void checkImplementationClasses(Environment environment, Class submodelImpl, Class propertyImpl) { environment.getSubmodels().forEach(submodel -> { From 99b6c80594b0ef72cbf88fb51ae9b071ad2da40f Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Fri, 2 Feb 2024 11:17:11 +0100 Subject: [PATCH 90/91] Refactoring of the tests --- .../dataformat/json/JsonDeserializerTest.java | 38 ++++++++++++++++--- .../dataformat/json/JsonSerializerTest.java | 37 ++++++++++-------- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 3bfe98b46..09de0298c 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -15,12 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; @@ -46,6 +48,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; public class JsonDeserializerTest { private static JsonDeserializer deserializerToTest; @@ -97,11 +100,34 @@ public void testReadConceptDescriptionWithPhysicalUnit() throws IOException, Des assertEquals(expected, actual); } + @Test + public void testReadNull() throws DeserializationException { + assertNull(deserializerToTest.read("null", Submodel.class)); + assertNull(deserializerToTest.readList("null", Submodel.class)); + + + assertNull(deserializerToTest.read(JsonNodeFactory.instance.nullNode(), Submodel.class)); + assertNull(deserializerToTest.readList(JsonNodeFactory.instance.nullNode(), Submodel.class)); + + ByteArrayInputStream bais = new ByteArrayInputStream("null".getBytes()); + assertNull(deserializerToTest.read(bais, Submodel.class)); + + bais = new ByteArrayInputStream("null".getBytes()); + assertNull(deserializerToTest.readList(bais, Submodel.class)); + } + @Test public void testReadEmptyReferableList() throws DeserializationException { List emptyList = Collections.emptyList(); + List deserialized = deserializerToTest.readList("[]", Referable.class); assertEquals(emptyList, deserialized); + + deserialized = deserializerToTest.readList(JsonNodeFactory.instance.arrayNode(), Referable.class); + assertEquals(emptyList, deserialized); + + ByteArrayInputStream bais = new ByteArrayInputStream("[]".getBytes()); + assertEquals(emptyList, deserializerToTest.readList(bais, Submodel.class)); } @Test @@ -160,7 +186,7 @@ public void testReadExtensionMinimalEnv() { } @Test - public void testReadExtensionMaximalEnv() throws Exception { + public void testReadExtensionMaximalEnv() { readAndCompare(Examples.EXTENSION_MAXIMAL); } @@ -169,6 +195,11 @@ public void testReadShellDescriptor() { readAndCompare(Examples.SHELL_DESCRIPTOR); } + @Test + public void testReadOperationRequest() { + readAndCompare(Examples.OPERATION_REQUEST); + } + @Test public void testReadShellDescriptors() throws IOException, DeserializationException { String jsonString = "[" + Examples.SHELL_DESCRIPTOR.fileContent() + "]"; @@ -177,11 +208,6 @@ public void testReadShellDescriptors() throws IOException, DeserializationExcept assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptors.get(0)); } - @Test - public void testReadOperationRequest() { - readAndCompare(Examples.OPERATION_REQUEST); - } - @Test public void testReadSubmodelDescriptor() { readAndCompare(Examples.SUBMODEL_DESCRIPTOR); diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 02544eb24..e46b96dec 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -80,6 +80,19 @@ public void testWriteNull() throws SerializationException { assertEquals("null", baos.toString()); } + @Test + public void testWriteEmptyReferableList() throws SerializationException, JSONException { + List emptyList = Collections.emptyList(); + String actual = serializerToTest.writeList(emptyList); + JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + serializerToTest.writeList(baos, emptyList); + JSONAssert.assertEquals("[]", baos.toString(), JSONCompareMode.NON_EXTENSIBLE); + + JSONAssert.assertEquals("[]", serializerToTest.toArrayNode(emptyList).toString(), JSONCompareMode.NON_EXTENSIBLE); + } + // This test is used only to show how to write to a file. @Test public void testWriteToFile() throws IOException, SerializationException { @@ -110,12 +123,6 @@ public void testFullExampleEnvToNode() throws IOException { validateAndCompare(expected, node.toPrettyString()); } - @Test - public void testWriteEmptyReferableList() throws SerializationException, JSONException { - List emptyList = Collections.emptyList(); - String actual = serializerToTest.writeList(emptyList); - JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); - } /** * This test ensures that future DataSpecificationContents can be added without adjustments in the code. @@ -212,7 +219,7 @@ public void testWriteOperationRequest() { writeAndCompare(Examples.OPERATION_REQUEST); } - private String write(ExampleData exampleData) throws SerializationException { + private String writeToString(ExampleData exampleData) throws SerializationException { String actual; if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { actual = serializerToTest.writeList((Collection) exampleData.getModel()); @@ -222,17 +229,17 @@ private String write(ExampleData exampleData) throws SerializationException { return actual; } - private String writeViaStream(ExampleData exampleData) throws SerializationException { + private String writeToStream(ExampleData exampleData) throws SerializationException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { - serializerToTest.writeList(baos, StandardCharsets.UTF_8, (Collection) exampleData.getModel()); + serializerToTest.writeList(baos, (Collection) exampleData.getModel()); } else { - serializerToTest.write(baos, StandardCharsets.UTF_8, exampleData.getModel()); + serializerToTest.write(baos, exampleData.getModel()); } return baos.toString(StandardCharsets.UTF_8); } - private JsonNode toNode(ExampleData exampleData) { + private JsonNode writeToNode(ExampleData exampleData) { JsonNode actual; if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { actual = serializerToTest.toArrayNode((Collection) exampleData.getModel()); @@ -251,9 +258,9 @@ private void compare(String expected, String actual) throws JSONException { private void writeAndCompare(ExampleData exampleData) { try { String expected = exampleData.fileContent(); - compare(expected, write(exampleData)); - assertEquals(exampleData.getJsonNode() , toNode(exampleData)); - compare(expected, writeViaStream(exampleData)); + compare(expected, writeToString(exampleData)); + assertEquals(exampleData.getJsonNode(), writeToNode(exampleData)); + compare(expected, writeToStream(exampleData)); } catch(Exception ex) { throw new RuntimeException(ex); } @@ -261,7 +268,7 @@ private void writeAndCompare(ExampleData exampleData) { private void writeValidateAndCompare(ExampleData exampleData) { try { - String actual = write(exampleData); + String actual = writeToString(exampleData); String expected = exampleData.fileContent(); validateAndCompare(expected, actual); } catch (Exception ex) { From ced05f51866fedcc18942bd18baeeff1aed91994 Mon Sep 17 00:00:00 2001 From: Emil Dinchev Date: Mon, 5 Feb 2024 14:30:38 +0100 Subject: [PATCH 91/91] Address review remarks --- .../dataformat/json/JsonDeserializerTest.java | 14 +++----------- .../dataformat/json/JsonSerializerTest.java | 19 +++---------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 09de0298c..45761420b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -58,19 +58,11 @@ public static void initialize() { deserializerToTest = new JsonDeserializer(); } - /** - * This test ensures that future DataSpecificationContents can be added without adjustments in the code. - * - * @throws SerializationException - * @throws DeserializationException - */ @Test public void testReadCustomDataSpecification() throws DeserializationException { - // This is the only way to make the serialization to work. - Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); - subtypes.add(DefaultDummyDataSpecification.class); - // We need to create a new deserializer instance here, to reflect the change in the subtypes. - Environment env = new JsonDeserializer().read(Examples.ENVIRONMENT_CUSTOM_DATA.fileContentStream(), Environment.class); + JsonDeserializer deserializer = new JsonDeserializer(); + deserializer.useImplementation(DataSpecificationContent.class, DefaultDummyDataSpecification.class); + Environment env = deserializer.read(Examples.ENVIRONMENT_CUSTOM_DATA.fileContentStream(), Environment.class); assertEquals(Examples.ENVIRONMENT_CUSTOM_DATA.getModel(), env); } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index e46b96dec..43ed8361b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -27,16 +27,13 @@ import java.util.Set; import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import com.fasterxml.jackson.databind.JsonNode; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import com.fasterxml.jackson.databind.JsonNode; import org.json.JSONException; import org.junit.BeforeClass; @@ -44,6 +41,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; + import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; import org.slf4j.Logger; @@ -93,7 +91,6 @@ public void testWriteEmptyReferableList() throws SerializationException, JSONExc JSONAssert.assertEquals("[]", serializerToTest.toArrayNode(emptyList).toString(), JSONCompareMode.NON_EXTENSIBLE); } - // This test is used only to show how to write to a file. @Test public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); @@ -123,18 +120,8 @@ public void testFullExampleEnvToNode() throws IOException { validateAndCompare(expected, node.toPrettyString()); } - - /** - * This test ensures that future DataSpecificationContents can be added without adjustments in the code. - * - * @throws SerializationException - * @throws DeserializationException - */ @Test public void testWriteCustomDataSpecification() { - // This is the only way to make the serialization to work. - Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); - subtypes.add(DefaultDummyDataSpecification.class); writeAndCompare(Examples.ENVIRONMENT_CUSTOM_DATA); }