-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.equals methods for collection-like elements #50
Comments
Check the final release spec if this issue has been addressed otherwise discuss internally |
@mjacoby to check if this issue is now resolved |
Current status Issue is not resolved. I also create a corresponding unit test testing the expected behavior according to the spec. It is available on the branch Before updating our implementation we need to clarify the expected behavior with the spec team. |
@mjacoby aas4j/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java Line 103 in 4c56bbe
can be changed to: Property.class.isInstance(this)==false|| Property.class.isInstance(obj)==false
aas4j/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java Line 106 in 4c56bbe
Furthermore, the casting to 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()); two questions can be raised here:
|
For some collection-like AAS type classes the
equals
method does not work as expected, e.g.returns false although
SubmodelElementCollection
is defined to not be ordered. Same goes forSubmodel
class.For
SubmodelElementList
this issue is more complex as it has theordered
property.All
.equals
calls return false in this example, whereasequalsWithoutOrder
should be true as order should be ignored.This behavior is not compliant with the current specification.
However, there is a discussion if the specification should be updated to ensure order in such collections (admin-shell-io/aas-specs#248).
Before any release we should make sure that we are compliant to the specification.
The text was updated successfully, but these errors were encountered: