Skip to content
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

Allow subclass in equals in Default implementations #248

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,201 +16,198 @@
*/
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<EmbeddedDataSpecification> embeddedDataSpecifications;

protected List<Reference> dataSpecifications;

protected ModellingKind kind;

protected Reference semanticId;

protected String value;

protected Reference valueId;

protected DataTypeDefXsd valueType;

protected List<Qualifier> qualifiers;

protected String category;

protected List<LangStringTextType> description;

protected List<LangStringNameType> displayName;

protected String idShort;

protected List<Extension> extensions;

protected List<Reference> 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<LangStringTextType> getDescription() {
return description;
}

@Override
final public void setDescription(List<LangStringTextType> description) {
this.description = description;
}

@Override
final public List<LangStringNameType> getDisplayName() {
return displayName;
}

@Override
final public void setDisplayName(List<LangStringNameType> 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<Qualifier> getQualifiers() {
return qualifiers;
}

@Override
final public void setQualifiers(List<Qualifier> qualifiers) {
this.qualifiers = qualifiers;
}

@Override
final public List<EmbeddedDataSpecification> getEmbeddedDataSpecifications() {
return embeddedDataSpecifications;
}

@Override
final public void setEmbeddedDataSpecifications(List<EmbeddedDataSpecification> embeddedDataSpecifications) {
this.embeddedDataSpecifications = embeddedDataSpecifications;
}

@Override
final public Reference getSemanticId() {
return semanticId;
}

@Override
final public void setSemanticId(Reference semanticId) {
this.semanticId = semanticId;
}

@Override
public List<Reference> getSupplementalSemanticIds() {
return supplementalSemanticIds;
}

@Override
public void setSupplementalSemanticIds(List<Reference> supplementalSemanticIds) {
this.supplementalSemanticIds = supplementalSemanticIds;
}

@Override
public List<Extension> getExtensions() {
return extensions;
}

@Override
public void setExtensions(List<Extension> list) {
this.extensions = list;
}
protected List<EmbeddedDataSpecification> embeddedDataSpecifications = new LinkedList<>();

protected Reference semanticId;

protected String value;

protected Reference valueId;

protected DataTypeDefXsd valueType;

protected List<Qualifier> qualifiers = new LinkedList<>();

protected String category;

protected List<LangStringTextType> description = new LinkedList<>();

protected List<LangStringNameType> displayName = new LinkedList<>();

protected String idShort;

protected List<Extension> extensions = new LinkedList<>();

protected List<Reference> 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)) {
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<LangStringTextType> getDescription() {
return description;
}

@Override
final public void setDescription(List<LangStringTextType> description) {
this.description = description;
}

@Override
final public List<LangStringNameType> getDisplayName() {
return displayName;
}

@Override
final public void setDisplayName(List<LangStringNameType> 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<Qualifier> getQualifiers() {
return qualifiers;
}

@Override
final public void setQualifiers(List<Qualifier> qualifiers) {
this.qualifiers = qualifiers;
}

@Override
final public List<EmbeddedDataSpecification> getEmbeddedDataSpecifications() {
return embeddedDataSpecifications;
}

@Override
final public void setEmbeddedDataSpecifications(List<EmbeddedDataSpecification> embeddedDataSpecifications) {
this.embeddedDataSpecifications = embeddedDataSpecifications;
}

@Override
final public Reference getSemanticId() {
return semanticId;
}

@Override
final public void setSemanticId(Reference semanticId) {
this.semanticId = semanticId;
}

@Override
public List<Reference> getSupplementalSemanticIds() {
return supplementalSemanticIds;
}

@Override
public void setSupplementalSemanticIds(List<Reference> supplementalSemanticIds) {
this.supplementalSemanticIds = supplementalSemanticIds;
}

@Override
public List<Extension> getExtensions() {
return extensions;
}

@Override
public void setExtensions(List<Extension> list) {
this.extensions = list;
}
}
Loading
Loading