From f82c88d5288770ae6eccdc072364ab12777f430e Mon Sep 17 00:00:00 2001 From: Hossein Rimaz Date: Sun, 11 Feb 2024 09:52:28 +0100 Subject: [PATCH 1/4] Fix issues with CustomProperty Wrong hashCode logic Make equals logic generic Initialize List objects --- .../v3/dataformat/core/CustomProperty.java | 382 +++++++++--------- 1 file changed, 192 insertions(+), 190 deletions(-) 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 65a7029d4..fc783c7ae 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,201 +16,203 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; -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.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.*; +import java.util.LinkedList; import java.util.List; import java.util.Objects; public class CustomProperty implements Property { - protected List embeddedDataSpecifications; - - protected List dataSpecifications; - - protected ModellingKind kind; - - protected Reference semanticId; - - protected String value; - - protected Reference valueId; - - protected DataTypeDefXsd valueType; - - protected List qualifiers; - - protected String category; - - protected List description; - - protected List displayName; - - protected String idShort; - - protected List extensions; - - protected List supplementalSemanticIds; - - 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.semanticId }); - } - - @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 { - 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) - && 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) - && Objects.equals(this.kind, other.kind) - && Objects.equals(this.semanticId, other.semanticId); - } - } - - @Override - final public DataTypeDefXsd getValueType() { - return this.valueType; - } - - @Override - final public void setValueType(DataTypeDefXsd dataType) { - this.valueType = dataType; - } - - @Override - final public String getValue() { - return value; - } - - @Override - final public void setValue(String value) { - this.value = value; - } - - @Override - final public Reference getValueId() { - return valueId; - } - - @Override - final public void setValueId(Reference valueId) { - this.valueId = valueId; - } - - @Override - final public String getCategory() { - return category; - } - - @Override - final public void setCategory(String category) { - this.category = category; - } - - @Override - final public List getDescription() { - return description; - } - - @Override - final public void setDescription(List description) { - this.description = description; - } - - @Override - final public List getDisplayName() { - return displayName; - } - - @Override - final public void setDisplayName(List displayName) { - this.displayName = displayName; - } - - @Override - final public String getIdShort() { - return idShort; - } - - @Override - final public void setIdShort(String idShort) { - this.idShort = idShort; - } - - @Override - final public List getQualifiers() { - return qualifiers; - } - - @Override - final public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - - @Override - final public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - final public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - - @Override - final public Reference getSemanticId() { - return semanticId; - } - - @Override - final 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 getExtensions() { - return extensions; - } - - @Override - public void setExtensions(List list) { - this.extensions = list; - } + protected List embeddedDataSpecifications = new LinkedList<>(); + ; + + protected Reference semanticId; + + protected String value; + + protected Reference valueId; + + protected DataTypeDefXsd valueType; + + protected List qualifiers = new LinkedList<>(); + ; + + protected String category; + + protected List description = new LinkedList<>(); + ; + + protected List displayName = new LinkedList<>(); + ; + + protected String idShort; + + protected List extensions = new LinkedList<>(); + ; + + protected List supplementalSemanticIds = new LinkedList<>(); + + protected CustomProperty() { + } + + @Override + public int hashCode() { + return Objects.hash(this.valueType, + this.value, + this.valueId, + 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 ((obj instanceof Property) == false) { + return false; + } else { + Property other = (Property) obj; + return Objects.equals(this.valueType, other.getValueType()) + && Objects.equals(this.value, other.getValue()) + && Objects.equals(this.valueId, other.getValueId()) + && Objects.equals(this.category, other.getCategory()) + && Objects.equals(this.description, other.getDescription()) + && Objects.equals(this.displayName, other.getDisplayName()) + && Objects.equals(this.idShort, other.getIdShort()) + && Objects.equals(this.qualifiers, other.getQualifiers()) + && Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) + && Objects.equals(this.semanticId, other.getSemanticId()); + } + } + + @Override + final public DataTypeDefXsd getValueType() { + return this.valueType; + } + + @Override + final public void setValueType(DataTypeDefXsd dataType) { + this.valueType = dataType; + } + + @Override + final public String getValue() { + return value; + } + + @Override + final public void setValue(String value) { + this.value = value; + } + + @Override + final public Reference getValueId() { + return valueId; + } + + @Override + final public void setValueId(Reference valueId) { + this.valueId = valueId; + } + + @Override + final public String getCategory() { + return category; + } + + @Override + final public void setCategory(String category) { + this.category = category; + } + + @Override + final public List getDescription() { + return description; + } + + @Override + final public void setDescription(List description) { + this.description = description; + } + + @Override + final public List getDisplayName() { + return displayName; + } + + @Override + final public void setDisplayName(List displayName) { + this.displayName = displayName; + } + + @Override + final public String getIdShort() { + return idShort; + } + + @Override + final public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + final public List getQualifiers() { + return qualifiers; + } + + @Override + final public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + + @Override + final public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + final public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + + @Override + final public Reference getSemanticId() { + return semanticId; + } + + @Override + final 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 getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List list) { + this.extensions = list; + } } From 4f562cd7cce21ce6d0ccf025e40e52977df7ca3d Mon Sep 17 00:00:00 2001 From: Hossein Rimaz Date: Sun, 11 Feb 2024 09:53:41 +0100 Subject: [PATCH 2/4] Add test for custom models --- .../digitaltwin/aas4j/v3/model/ModelTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelTest.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelTest.java new file mode 100644 index 000000000..10b30e148 --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/ModelTest.java @@ -0,0 +1,30 @@ +package org.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.junit.Test; + +public class ModelTest { + + void fillProperty(Property object) { + object.setIdShort("test"); + object.setValueType(DataTypeDefXsd.STRING); + } + + @Test + public void testPropertyEqualityWithSubclass() { + Property defaultProperty = new DefaultProperty(); + Property customProperty = new CustomSubProperty(); + fillProperty(customProperty); + fillProperty(defaultProperty); + + //object should be equal to itself + assert defaultProperty.equals(defaultProperty); + //defaultProperty should be equal with customProperty + assert defaultProperty.equals(customProperty); + assert customProperty.equals(customProperty); + assert customProperty.equals(defaultProperty); + //hashCode implementation should be consistent + assert customProperty.hashCode() == defaultProperty.hashCode(); + } +} From 838b0a38abf4585d0fcf4904ab7ad22757c9acc8 Mon Sep 17 00:00:00 2001 From: Hossein Rimaz Date: Sun, 11 Feb 2024 14:04:05 +0100 Subject: [PATCH 3/4] Allow subclass in equals --- .../DefaultAdministrativeInformation.java | 14 +++--- .../DefaultAnnotatedRelationshipElement.java | 37 ++++++-------- .../impl/DefaultAssetAdministrationShell.java | 35 ++++++-------- ...ultAssetAdministrationShellDescriptor.java | 38 ++++++--------- .../model/impl/DefaultAssetInformation.java | 19 ++++---- .../impl/DefaultBaseOperationResult.java | 11 +++-- .../model/impl/DefaultBasicEventElement.java | 48 ++++++++----------- .../aas4j/v3/model/impl/DefaultBlob.java | 34 ++++++------- .../v3/model/impl/DefaultCapability.java | 30 +++++------- .../model/impl/DefaultConceptDescription.java | 30 +++++------- .../DefaultDataSpecificationIec61360.java | 37 ++++++-------- .../v3/model/impl/DefaultDescriptor.java | 15 +++--- .../DefaultEmbeddedDataSpecification.java | 9 ++-- .../aas4j/v3/model/impl/DefaultEndpoint.java | 9 ++-- .../aas4j/v3/model/impl/DefaultEntity.java | 41 +++++++--------- .../v3/model/impl/DefaultEnvironment.java | 10 ++-- .../v3/model/impl/DefaultEventPayload.java | 21 ++++---- .../aas4j/v3/model/impl/DefaultExtension.java | 17 +++---- .../aas4j/v3/model/impl/DefaultFile.java | 34 ++++++------- .../aas4j/v3/model/impl/DefaultKey.java | 9 ++-- ...faultLangStringDefinitionTypeIec61360.java | 9 ++-- .../model/impl/DefaultLangStringNameType.java | 9 ++-- ...ltLangStringPreferredNameTypeIec61360.java | 9 ++-- ...efaultLangStringShortNameTypeIec61360.java | 9 ++-- .../model/impl/DefaultLangStringTextType.java | 9 ++-- .../aas4j/v3/model/impl/DefaultLevelType.java | 13 ++--- .../aas4j/v3/model/impl/DefaultMessage.java | 3 +- .../impl/DefaultMultiLanguageProperty.java | 34 ++++++------- .../aas4j/v3/model/impl/DefaultOperation.java | 37 ++++++-------- .../v3/model/impl/DefaultOperationHandle.java | 7 +-- .../model/impl/DefaultOperationRequest.java | 11 +++-- .../v3/model/impl/DefaultOperationResult.java | 9 ++-- .../model/impl/DefaultOperationVariable.java | 7 +-- .../model/impl/DefaultPackageDescription.java | 9 ++-- .../aas4j/v3/model/impl/DefaultProperty.java | 37 ++++++-------- .../impl/DefaultProtocolInformation.java | 19 ++++---- .../aas4j/v3/model/impl/DefaultQualifier.java | 23 ++++----- .../aas4j/v3/model/impl/DefaultRange.java | 37 ++++++-------- .../aas4j/v3/model/impl/DefaultReference.java | 11 +++-- .../model/impl/DefaultReferenceElement.java | 32 +++++-------- .../impl/DefaultRelationshipElement.java | 34 ++++++------- .../aas4j/v3/model/impl/DefaultResource.java | 9 ++-- .../aas4j/v3/model/impl/DefaultResult.java | 7 +-- .../impl/DefaultSecurityAttributeObject.java | 11 +++-- .../v3/model/impl/DefaultSpecificAssetId.java | 15 +++--- .../aas4j/v3/model/impl/DefaultSubmodel.java | 41 +++++++--------- .../model/impl/DefaultSubmodelDescriptor.java | 30 +++++------- .../DefaultSubmodelElementCollection.java | 33 +++++-------- .../impl/DefaultSubmodelElementList.java | 43 +++++++---------- .../aas4j/v3/model/impl/DefaultValueList.java | 7 +-- .../model/impl/DefaultValueReferencePair.java | 9 ++-- 51 files changed, 474 insertions(+), 597 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 e13dbd853..03a1ccb8f 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 @@ -68,15 +68,15 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof AdministrativeInformation) == false) { 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) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); + AdministrativeInformation other = (AdministrativeInformation) obj; + return Objects.equals(this.version, other.getVersion()) && + Objects.equals(this.revision, other.getRevision()) && + Objects.equals(this.creator, other.getCreator()) && + Objects.equals(this.templateId, other.getTemplateId()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()); } } 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 1f771a2d1..b522ffa2e 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,14 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AnnotatedRelationshipElement; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -102,22 +95,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof AnnotatedRelationshipElement) == false) { return false; } else { - DefaultAnnotatedRelationshipElement other = (DefaultAnnotatedRelationshipElement) obj; - return Objects.equals(this.annotations, other.annotations) && - Objects.equals(this.first, other.first) && - Objects.equals(this.second, other.second) && - 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); + AnnotatedRelationshipElement other = (AnnotatedRelationshipElement) obj; + return Objects.equals(this.annotations, other.getAnnotations()) && + Objects.equals(this.first, other.getFirst()) && + Objects.equals(this.second, other.getSecond()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 755ef9896..9c82237de 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,14 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -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.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellBuilder; @@ -96,21 +89,21 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof AssetAdministrationShell) == false) { return false; } else { - DefaultAssetAdministrationShell other = (DefaultAssetAdministrationShell) obj; - return Objects.equals(this.derivedFrom, other.derivedFrom) && - Objects.equals(this.assetInformation, other.assetInformation) && - Objects.equals(this.submodels, other.submodels) && - 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); + AssetAdministrationShell other = (AssetAdministrationShell) obj; + return Objects.equals(this.derivedFrom, other.getDerivedFrom()) && + Objects.equals(this.assetInformation, other.getAssetInformation()) && + Objects.equals(this.submodels, other.getSubmodels()) && + Objects.equals(this.administration, other.getAdministration()) && + Objects.equals(this.id, other.getId()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()); } } 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 3d483e26a..193145e25 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 @@ -15,15 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -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.SpecificAssetId; -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.AssetAdministrationShellDescriptorBuilder; @@ -101,22 +93,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof AssetAdministrationShellDescriptor) == false) { return false; } else { - DefaultAssetAdministrationShellDescriptor other = (DefaultAssetAdministrationShellDescriptor) obj; - return Objects.equals(this.administration, other.administration) && - 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.specificAssetIds, other.specificAssetIds) && - Objects.equals(this.submodelDescriptors, other.submodelDescriptors) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.extensions, other.extensions); + AssetAdministrationShellDescriptor other = (AssetAdministrationShellDescriptor) obj; + return Objects.equals(this.administration, other.getAdministration()) && + Objects.equals(this.assetKind, other.getAssetKind()) && + Objects.equals(this.assetType, other.getAssetType()) && + Objects.equals(this.endpoints, other.getEndpoints()) && + Objects.equals(this.globalAssetId, other.getGlobalAssetId()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.id, other.getId()) && + Objects.equals(this.specificAssetIds, other.getSpecificAssetIds()) && + Objects.equals(this.submodelDescriptors, other.getSubmodelDescriptors()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.extensions, other.getExtensions()); } } 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..8b2795e1d 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,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; @@ -69,15 +66,15 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof AssetInformation) == false) { return false; } 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); + AssetInformation other = (AssetInformation) obj; + return Objects.equals(this.assetKind, other.getAssetKind()) && + Objects.equals(this.globalAssetId, other.getGlobalAssetId()) && + Objects.equals(this.specificAssetIds, other.getSpecificAssetIds()) && + Objects.equals(this.assetType, other.getAssetKind()) && + Objects.equals(this.defaultThumbnail, other.getDefaultThumbnail()); } } 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 index e9507263c..f32204e33 100644 --- 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult; import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; import org.eclipse.digitaltwin.aas4j.v3.model.Message; @@ -58,13 +59,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof BaseOperationResult) == false) { 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); + BaseOperationResult other = (BaseOperationResult) obj; + return Objects.equals(this.executionState, other.getExecutionState()) && + Objects.equals(this.success, other.getSuccess()) && + Objects.equals(this.messages, other.getMessages()); } } 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 c7fbf209c..62f463342 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,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.BasicEventElement; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; +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; @@ -121,27 +113,27 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof BasicEventElement) == false) { 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) && - Objects.equals(this.lastUpdate, other.lastUpdate) && - Objects.equals(this.minInterval, other.minInterval) && - Objects.equals(this.maxInterval, other.maxInterval) && - 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); + BasicEventElement other = (BasicEventElement) obj; + return Objects.equals(this.observed, other.getObserved()) && + Objects.equals(this.direction, other.getDirection()) && + Objects.equals(this.state, other.getState()) && + Objects.equals(this.messageTopic, other.getMessageTopic()) && + Objects.equals(this.messageBroker, other.getMessageBroker()) && + Objects.equals(this.lastUpdate, other.getLastUpdate()) && + Objects.equals(this.minInterval, other.getMinInterval()) && + Objects.equals(this.maxInterval, other.getMaxInterval()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 c0208e296..e78f73e7e 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,13 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Blob; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -97,21 +91,21 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Blob) == false) { return false; } else { - DefaultBlob other = (DefaultBlob) obj; - return Arrays.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && - 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); + Blob other = (Blob) obj; + return Arrays.equals(this.value, other.getValue()) && + Objects.equals(this.contentType, other.getContentType()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 4f249157c..880d9f31c 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,13 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Capability; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -88,19 +82,19 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Capability) == false) { return false; } else { - DefaultCapability other = (DefaultCapability) obj; - return 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); + Capability other = (Capability) obj; + return Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 0e7d03eb7..75a067f11 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,13 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -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.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.ConceptDescriptionBuilder; @@ -88,19 +82,19 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof ConceptDescription) == false) { return false; } else { - DefaultConceptDescription other = (DefaultConceptDescription) obj; - return Objects.equals(this.isCaseOf, other.isCaseOf) && - 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); + ConceptDescription other = (ConceptDescription) obj; + return Objects.equals(this.isCaseOf, other.getIsCaseOf()) && + Objects.equals(this.administration, other.getAdministration()) && + Objects.equals(this.id, other.getId()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()); } } 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 a92cab507..906a3fc84 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,14 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; -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 org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.DataSpecificationIec61360Builder; @@ -102,22 +95,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof DataSpecificationIec61360) == false) { return false; } else { - DefaultDataSpecificationIec61360 other = (DefaultDataSpecificationIec61360) obj; - return Objects.equals(this.preferredName, other.preferredName) && - Objects.equals(this.shortName, other.shortName) && - 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.dataType, other.dataType) && - Objects.equals(this.definition, other.definition) && - Objects.equals(this.valueFormat, other.valueFormat) && - Objects.equals(this.valueList, other.valueList) && - Objects.equals(this.value, other.value) && - Objects.equals(this.levelType, other.levelType); + DataSpecificationIec61360 other = (DataSpecificationIec61360) obj; + return Objects.equals(this.preferredName, other.getPreferredName()) && + Objects.equals(this.shortName, other.getShortName()) && + Objects.equals(this.unit, other.getUnit()) && + Objects.equals(this.unitId, other.getUnitId()) && + Objects.equals(this.sourceOfDefinition, other.getSourceOfDefinition()) && + Objects.equals(this.symbol, other.getSymbol()) && + Objects.equals(this.dataType, other.getDataType()) && + Objects.equals(this.definition, other.getDefinition()) && + Objects.equals(this.valueFormat, other.getValueFormat()) && + Objects.equals(this.valueList, other.getValueList()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.levelType, other.getLevelType()); } } 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 f3496933a..7534d4b73 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 @@ -15,10 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; -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.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.DescriptorBuilder; @@ -59,13 +56,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Descriptor) == false) { return false; } else { - DefaultDescriptor other = (DefaultDescriptor) obj; - return Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.extensions, other.extensions); + Descriptor other = (Descriptor) obj; + return Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.extensions, other.getExtensions()); } } 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..cfd9fb53e 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -54,12 +55,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof EmbeddedDataSpecification) == false) { return false; } else { - DefaultEmbeddedDataSpecification other = (DefaultEmbeddedDataSpecification) obj; - return Objects.equals(this.dataSpecification, other.dataSpecification) && - Objects.equals(this.dataSpecificationContent, other.dataSpecificationContent); + EmbeddedDataSpecification other = (EmbeddedDataSpecification) obj; + return Objects.equals(this.dataSpecification, other.getDataSpecification()) && + Objects.equals(this.dataSpecificationContent, other.getDataSpecificationContent()); } } 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 91167f351..a0b673029 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -51,12 +52,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Endpoint) == false) { return false; } else { - DefaultEndpoint other = (DefaultEndpoint) obj; - return Objects.equals(this._interface, other._interface) && - Objects.equals(this.protocolInformation, other.protocolInformation); + Endpoint other = (Endpoint) obj; + return Objects.equals(this._interface, other.get_interface()) && + Objects.equals(this.protocolInformation, other.getProtocolInformation()); } } 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 9df1c5a11..ac64d289b 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,16 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Entity; -import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +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; @@ -106,23 +97,23 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Entity) == false) { return false; } else { - DefaultEntity other = (DefaultEntity) obj; - 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.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); + Entity other = (Entity) obj; + return Objects.equals(this.statements, other.getStatements()) && + Objects.equals(this.entityType, other.getEntityType()) && + Objects.equals(this.globalAssetId, other.getGlobalAssetId()) && + Objects.equals(this.specificAssetIds, other.getSpecificAssetIds()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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..cb9c7b0a7 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 @@ -60,13 +60,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Environment) == false) { return false; } else { - DefaultEnvironment other = (DefaultEnvironment) obj; - return Objects.equals(this.assetAdministrationShells, other.assetAdministrationShells) && - Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.conceptDescriptions, other.conceptDescriptions); + Environment other = (Environment) obj; + return Objects.equals(this.assetAdministrationShells, other.getAssetAdministrationShells()) && + Objects.equals(this.submodels, other.getSubmodels()) && + Objects.equals(this.conceptDescriptions, other.getConceptDescriptions()); } } 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 5e9a29003..ba3e87c9d 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -77,18 +78,18 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof EventPayload) == false) { 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) && - Objects.equals(this.observableSemanticId, other.observableSemanticId) && - Objects.equals(this.topic, other.topic) && - Objects.equals(this.subjectId, other.subjectId) && - Objects.equals(this.timeStamp, other.timeStamp) && - Arrays.equals(this.payload, other.payload); + EventPayload other = (EventPayload) obj; + return Objects.equals(this.source, other.getSource()) && + Objects.equals(this.sourceSemanticId, other.getSourceSemanticId()) && + Objects.equals(this.observableReference, other.getObservableReference()) && + Objects.equals(this.observableSemanticId, other.getObservableSemanticId()) && + Objects.equals(this.topic, other.getTopic()) && + Objects.equals(this.subjectId, other.getSubjectId()) && + Objects.equals(this.timeStamp, other.getTimeStamp()) && + Arrays.equals(this.payload, other.getPayload()); } } 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..7fd855816 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; @@ -71,16 +72,16 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Extension) == false) { return false; } else { - DefaultExtension other = (DefaultExtension) obj; - return Objects.equals(this.name, other.name) && - 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); + Extension other = (Extension) obj; + return Objects.equals(this.name, other.getName()) && + Objects.equals(this.valueType, other.getValueType()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.refersTo, other.getRefersTo()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()); } } 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 0b0251441..8e2cff4ad 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,13 +15,7 @@ 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.File; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -95,21 +89,21 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof File) == false) { return false; } else { - DefaultFile other = (DefaultFile) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.contentType, other.contentType) && - 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); + File other = (File) obj; + return Objects.equals(this.value, other.getValue()) && + Objects.equals(this.contentType, other.getContentType()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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..764f05902 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Key) == false) { return false; } else { - DefaultKey other = (DefaultKey) obj; - return Objects.equals(this.type, other.type) && - Objects.equals(this.value, other.value); + Key other = (Key) obj; + return Objects.equals(this.type, other.getType()) && + Objects.equals(this.value, other.getValue()); } } 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..7be722802 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LangStringDefinitionTypeIec61360) == false) { return false; } else { - DefaultLangStringDefinitionTypeIec61360 other = (DefaultLangStringDefinitionTypeIec61360) obj; - return Objects.equals(this.language, other.language) && - Objects.equals(this.text, other.text); + LangStringDefinitionTypeIec61360 other = (LangStringDefinitionTypeIec61360) obj; + return Objects.equals(this.language, other.getLanguage()) && + Objects.equals(this.text, other.getText()); } } 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..6cc538279 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -51,12 +52,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LangStringNameType) == false) { return false; } else { - DefaultLangStringNameType other = (DefaultLangStringNameType) obj; - return Objects.equals(this.language, other.language) && - Objects.equals(this.text, other.text); + LangStringNameType other = (LangStringNameType) obj; + return Objects.equals(this.language, other.getLanguage()) && + Objects.equals(this.text, other.getText()); } } 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..e7fbac443 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LangStringPreferredNameTypeIec61360) == false) { return false; } else { - DefaultLangStringPreferredNameTypeIec61360 other = (DefaultLangStringPreferredNameTypeIec61360) obj; - return Objects.equals(this.language, other.language) && - Objects.equals(this.text, other.text); + LangStringPreferredNameTypeIec61360 other = (LangStringPreferredNameTypeIec61360) obj; + return Objects.equals(this.language, other.getLanguage()) && + Objects.equals(this.text, other.getText()); } } 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..f5f0722ee 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LangStringShortNameTypeIec61360) == false) { return false; } else { - DefaultLangStringShortNameTypeIec61360 other = (DefaultLangStringShortNameTypeIec61360) obj; - return Objects.equals(this.language, other.language) && - Objects.equals(this.text, other.text); + LangStringShortNameTypeIec61360 other = (LangStringShortNameTypeIec61360) obj; + return Objects.equals(this.language, other.getLanguage()) && + Objects.equals(this.text, other.getText()); } } 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..26297210f 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -51,12 +52,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LangStringTextType) == false) { return false; } else { - DefaultLangStringTextType other = (DefaultLangStringTextType) obj; - return Objects.equals(this.language, other.language) && - Objects.equals(this.text, other.text); + LangStringTextType other = (LangStringTextType) obj; + return Objects.equals(this.language, other.getLanguage()) && + Objects.equals(this.text, other.getText()); } } 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..e35ddfb6f 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -60,14 +61,14 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof LevelType) == false) { return false; } else { - DefaultLevelType other = (DefaultLevelType) obj; - return Objects.equals(this.min, other.min) && - Objects.equals(this.nom, other.nom) && - Objects.equals(this.typ, other.typ) && - Objects.equals(this.max, other.max); + LevelType other = (LevelType) obj; + return Objects.equals(this.min, other.getMin()) && + Objects.equals(this.nom, other.getNom()) && + Objects.equals(this.typ, other.getTyp()) && + Objects.equals(this.max, other.getMax()); } } 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 89b06f102..03f7525a2 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.Message; import org.eclipse.digitaltwin.aas4j.v3.model.MessageTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -63,7 +64,7 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Message) == false) { return false; } else { DefaultMessage other = (DefaultMessage) obj; 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 651b3beb7..aa21e0840 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,13 +15,7 @@ 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.MultiLanguageProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -95,21 +89,21 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof MultiLanguageProperty) == false) { return false; } else { - DefaultMultiLanguageProperty other = (DefaultMultiLanguageProperty) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueId, other.valueId) && - 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); + MultiLanguageProperty other = (MultiLanguageProperty) obj; + return Objects.equals(this.value, other.getValue()) && + Objects.equals(this.valueId, other.getValueId()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 5615c9158..480495d12 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,14 +15,7 @@ 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.Operation; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -100,22 +93,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Operation) == false) { return false; } else { - DefaultOperation other = (DefaultOperation) obj; - 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.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); + Operation other = (Operation) obj; + return Objects.equals(this.inputVariables, other.getInputVariables()) && + Objects.equals(this.outputVariables, other.getOutputVariables()) && + Objects.equals(this.inoutputVariables, other.getInoutputVariables()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSemanticId()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 7a1160c44..5929f7442 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.OperationHandle; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationHandleBuilder; @@ -46,11 +47,11 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof OperationHandle) == false) { return false; } else { - DefaultOperationHandle other = (DefaultOperationHandle) obj; - return Objects.equals(this.handleId, other.handleId); + OperationHandle other = (OperationHandle) obj; + return Objects.equals(this.handleId, other.getHandleId()); } } 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 71bda258e..b66252e00 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -58,13 +59,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof OperationRequest) == false) { return false; } else { - DefaultOperationRequest other = (DefaultOperationRequest) obj; - return Objects.equals(this.inoutputArguments, other.inoutputArguments) && - Objects.equals(this.inputArguments, other.inputArguments) && - Objects.equals(this.clientTimeoutDuration, other.clientTimeoutDuration); + OperationRequest other = (OperationRequest) obj; + return Objects.equals(this.inoutputArguments, other.getInoutputArguments()) && + Objects.equals(this.inputArguments, other.getInputArguments()) && + Objects.equals(this.clientTimeoutDuration, other.getClientTimeoutDuration()); } } 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 763676200..600e16d87 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.OperationResult; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -53,12 +54,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof OperationResult) == false) { return false; } else { - DefaultOperationResult other = (DefaultOperationResult) obj; - return Objects.equals(this.inoutputArguments, other.inoutputArguments) && - Objects.equals(this.outputArguments, other.outputArguments); + OperationResult other = (OperationResult) obj; + return Objects.equals(this.inoutputArguments, other.getInoutputArguments()) && + Objects.equals(this.outputArguments, other.getOutputArguments()); } } 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..9b607d075 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -49,11 +50,11 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof OperationVariable) == false) { return false; } else { - DefaultOperationVariable other = (DefaultOperationVariable) obj; - return Objects.equals(this.value, other.value); + OperationVariable other = (OperationVariable) obj; + return Objects.equals(this.value, other.getValue()); } } 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 43612361c..b79af8862 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.PackageDescription; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.PackageDescriptionBuilder; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof PackageDescription) == false) { return false; } else { - DefaultPackageDescription other = (DefaultPackageDescription) obj; - return Objects.equals(this.items, other.items) && - Objects.equals(this.packageId, other.packageId); + PackageDescription other = (PackageDescription) obj; + return Objects.equals(this.items, other.getItems()) && + Objects.equals(this.packageId, other.getPackageId()); } } 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 73bce3b3a..42dbfda2e 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,14 +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.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.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -100,22 +93,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Property) == false) { return false; } else { - DefaultProperty other = (DefaultProperty) obj; - 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.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); + Property other = (Property) obj; + return Objects.equals(this.valueType, other.getValueType()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.valueId, other.getValueId()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 6b2639f9e..8ee80d89d 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -73,17 +74,17 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof ProtocolInformation) == false) { return false; } else { - DefaultProtocolInformation other = (DefaultProtocolInformation) obj; - 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) && - Objects.equals(this.subprotocolBody, other.subprotocolBody) && - Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding) && - Objects.equals(this.securityAttributes, other.securityAttributes); + ProtocolInformation other = (ProtocolInformation) obj; + return Objects.equals(this.href, other.getHref()) && + Objects.equals(this.endpointProtocol, other.getEndpointProtocol()) && + Objects.equals(this.endpointProtocolVersion, other.getEndpointProtocolVersion()) && + Objects.equals(this.subprotocol, other.getSubprotocol()) && + Objects.equals(this.subprotocolBody, other.getSubprotocolBody()) && + Objects.equals(this.subprotocolBodyEncoding, other.getSubprotocolBodyEncoding()) && + Objects.equals(this.securityAttributes, other.getSecurityAttributes()); } } 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 69dff5350..3eabf9bb1 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,10 +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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.QualifierKind; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.*; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; import org.eclipse.digitaltwin.aas4j.v3.model.builder.QualifierBuilder; @@ -79,17 +76,17 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Qualifier) == false) { return false; } else { - 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.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds); + Qualifier other = (Qualifier) obj; + return Objects.equals(this.kind, other.getKind()) && + Objects.equals(this.type, other.getType()) && + Objects.equals(this.valueType, other.getValueType()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.valueId, other.getValueId()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()); } } 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 546aa64f4..11135d59f 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,14 +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.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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Range; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +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; @@ -100,22 +93,22 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Range) == false) { return false; } else { - DefaultRange other = (DefaultRange) obj; - return Objects.equals(this.valueType, other.valueType) && - Objects.equals(this.min, other.min) && - Objects.equals(this.max, other.max) && - 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); + Range other = (Range) obj; + return Objects.equals(this.valueType, other.getValueType()) && + Objects.equals(this.min, other.getMin()) && + Objects.equals(this.max, other.getMax()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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..0c6e83a38 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; @@ -59,13 +60,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Reference) == false) { return false; } else { - DefaultReference other = (DefaultReference) obj; - return Objects.equals(this.type, other.type) && - Objects.equals(this.referredSemanticId, other.referredSemanticId) && - Objects.equals(this.keys, other.keys); + Reference other = (Reference) obj; + return Objects.equals(this.type, other.getType()) && + Objects.equals(this.referredSemanticId, other.getReferredSemanticId()) && + Objects.equals(this.keys, other.getKeys()); } } 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 dfddd18e7..94ec14153 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,13 +15,7 @@ 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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceElement; +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; @@ -92,20 +86,20 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof ReferenceElement) == false) { return false; } else { - DefaultReferenceElement other = (DefaultReferenceElement) obj; - return Objects.equals(this.value, other.value) && - 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); + ReferenceElement other = (ReferenceElement) obj; + return Objects.equals(this.value, other.getValue()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 475518459..e898eff46 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,13 +15,7 @@ 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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.RelationshipElement; +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; @@ -96,21 +90,21 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof RelationshipElement) == false) { return false; } else { - DefaultRelationshipElement other = (DefaultRelationshipElement) obj; - return Objects.equals(this.first, other.first) && - Objects.equals(this.second, other.second) && - 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); + RelationshipElement other = (RelationshipElement) obj; + return Objects.equals(this.first, other.getFirst()) && + Objects.equals(this.second, other.getSecond()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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..f27a76580 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -52,12 +53,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Resource) == false) { return false; } else { - DefaultResource other = (DefaultResource) obj; - return Objects.equals(this.path, other.path) && - Objects.equals(this.contentType, other.contentType); + Resource other = (Resource) obj; + return Objects.equals(this.path, other.getPath()) && + Objects.equals(this.contentType, other.getContentType()); } } 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 fa5e27a11..454ef6b34 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.Message; import org.eclipse.digitaltwin.aas4j.v3.model.Result; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -49,11 +50,11 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Result) == false) { return false; } else { - DefaultResult other = (DefaultResult) obj; - return Objects.equals(this.messages, other.messages); + Result other = (Result) obj; + return Objects.equals(this.messages, other.getMessages()); } } 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 index e2497b864..57f5f89a4 100644 --- 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 @@ -15,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; @@ -55,13 +56,13 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof SecurityAttributeObject) == false) { 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); + SecurityAttributeObject other = (SecurityAttributeObject) obj; + return Objects.equals(this.type, other.getType()) && + Objects.equals(this.key, other.getKey()) && + Objects.equals(this.value, other.getValue()); } } 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..ff6501cc1 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -66,15 +67,15 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof SpecificAssetId) == false) { return false; } else { - DefaultSpecificAssetId other = (DefaultSpecificAssetId) obj; - 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); + SpecificAssetId other = (SpecificAssetId) obj; + return Objects.equals(this.name, other.getName()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.externalSubjectId, other.getExternalSubjectId()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()); } } 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 424e2318e..9e58dc743 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,16 +15,7 @@ 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.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +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; @@ -108,23 +99,23 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof Submodel) == false) { return false; } 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) && - 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.qualifiers, other.qualifiers); + Submodel other = (Submodel) obj; + return Objects.equals(this.submodelElements, other.getSubmodelElements()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.kind, other.getKind()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSemanticId()) && + Objects.equals(this.administration, other.getAdministration()) && + Objects.equals(this.id, other.getId()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 794fdf368..a6c4af3bd 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 @@ -15,13 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; -import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; -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.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; @@ -86,19 +80,19 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof SubmodelDescriptor) == false) { return false; } else { - DefaultSubmodelDescriptor other = (DefaultSubmodelDescriptor) obj; - return Objects.equals(this.administration, other.administration) && - 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.supplementalSemanticId, other.supplementalSemanticId) && - Objects.equals(this.description, other.description) && - Objects.equals(this.displayName, other.displayName) && - Objects.equals(this.extensions, other.extensions); + SubmodelDescriptor other = (SubmodelDescriptor) obj; + return Objects.equals(this.administration, other.getAdministration()) && + Objects.equals(this.endpoints, other.getEndpoints()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.id, other.getId()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticId, other.getSupplementalSemanticId()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.extensions, other.getExtensions()); } } 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 d12c19192..5f1e3592d 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,14 +15,7 @@ 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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +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; @@ -94,20 +87,20 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof SubmodelElementCollection) == false) { return false; } else { - DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; - return Objects.equals(this.value, other.value) && - 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); + SubmodelElementCollection other = (SubmodelElementCollection) obj; + return Objects.equals(this.value, other.getValue()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()); } } 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 8658b51ca..7fa030328 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,16 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -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.Qualifier; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +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; @@ -112,24 +103,24 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof SubmodelElementList) == false) { return false; } else { - DefaultSubmodelElementList other = (DefaultSubmodelElementList) 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.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); + SubmodelElementList other = (SubmodelElementList) obj; + return Objects.equals(this.orderRelevant, other.getOrderRelevant()) && + Objects.equals(this.semanticIdListElement, other.getSemanticIdListElement()) && + Objects.equals(this.typeValueListElement, other.getTypeValueListElement()) && + Objects.equals(this.valueTypeListElement, other.getValueTypeListElement()) && + Objects.equals(this.value, other.getValue()) && + Objects.equals(this.embeddedDataSpecifications, other.getEmbeddedDataSpecifications()) && + Objects.equals(this.semanticId, other.getSemanticId()) && + Objects.equals(this.supplementalSemanticIds, other.getSupplementalSemanticIds()) && + Objects.equals(this.qualifiers, other.getQualifiers()) && + Objects.equals(this.category, other.getCategory()) && + Objects.equals(this.idShort, other.getIdShort()) && + Objects.equals(this.displayName, other.getDisplayName()) && + Objects.equals(this.description, other.getDescription()) && + Objects.equals(this.extensions, other.getExtensions()); } } 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..d66fa5d4d 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -50,11 +51,11 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof ValueList) == false) { return false; } else { - DefaultValueList other = (DefaultValueList) obj; - return Objects.equals(this.valueReferencePairs, other.valueReferencePairs); + ValueList other = (ValueList) obj; + return Objects.equals(this.valueReferencePairs, other.getValueReferencePairs()); } } 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..7b9b77682 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,6 +15,7 @@ package org.eclipse.digitaltwin.aas4j.v3.model.impl; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; 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; @@ -53,12 +54,12 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if (this.getClass() != obj.getClass()) { + } else if ((obj instanceof ValueReferencePair) == false) { return false; } else { - DefaultValueReferencePair other = (DefaultValueReferencePair) obj; - return Objects.equals(this.value, other.value) && - Objects.equals(this.valueId, other.valueId); + ValueReferencePair other = (ValueReferencePair) obj; + return Objects.equals(this.value, other.getValue()) && + Objects.equals(this.valueId, other.getValueId()); } } From fefa728bae84d8686c08af2553ca4f2cd6ee9cfd Mon Sep 17 00:00:00 2001 From: Hossein Rimaz Date: Sun, 11 Feb 2024 14:16:50 +0100 Subject: [PATCH 4/4] Fix formatting --- .../aas4j/v3/dataformat/core/CustomProperty.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 fc783c7ae..a6eb1735d 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 @@ -26,7 +26,6 @@ public class CustomProperty implements Property { protected List embeddedDataSpecifications = new LinkedList<>(); - ; protected Reference semanticId; @@ -37,20 +36,16 @@ public class CustomProperty implements Property { protected DataTypeDefXsd valueType; protected List qualifiers = new LinkedList<>(); - ; protected String category; protected List description = new LinkedList<>(); - ; protected List displayName = new LinkedList<>(); - ; protected String idShort; protected List extensions = new LinkedList<>(); - ; protected List supplementalSemanticIds = new LinkedList<>(); @@ -79,7 +74,7 @@ public boolean equals(Object obj) { return true; } else if (obj == null) { return false; - } else if ((obj instanceof Property) == false) { + } else if (!(obj instanceof Property)) { return false; } else { Property other = (Property) obj;