X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FVariableReference.java;h=cd1f384541d55144d5ee5aea9f16bd663331e8ab;hp=97e897ff44ed75ad6d267a18e7bb393a79ba97f5;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableReference.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableReference.java index 97e897ff4..cd1f38454 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableReference.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/VariableReference.java @@ -1,70 +1,70 @@ -package org.simantics.db.layer0.variable; - -import org.simantics.databoard.type.Datatype; -import org.simantics.utils.ObjectUtils; - -/** - * @author Tuukka Lehtonen - */ -public class VariableReference { - - public final RVI variableId; - - public final Datatype datatype; - - public String label; - - public static VariableReference of(RVI variableId, Datatype datatype, String label) { - return new VariableReference(variableId, datatype, label); - } - - public VariableReference(RVI variableId, Datatype datatype, String label) { - if (variableId == null) - throw new NullPointerException("null variable reference"); - this.variableId = variableId; - this.datatype = datatype; - this.label = label; - } - - public RVI getVariableId() { - return variableId; - } - - public Datatype getDatatype() { - return datatype; - } - - public String getLabel() { - return label; - } - - @Override - public int hashCode() { - return ObjectUtils.hashCode(datatype) * 31 + variableId.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - VariableReference other = (VariableReference) obj; - return variableId.equals(other.variableId) && ObjectUtils.objectEquals(datatype, other.datatype); -// && ObjectUtils.objectEquals(label, other.label); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(variableId); - if (datatype != null) - sb.append(" : ").append(datatype.toSingleLineString()); - if (label != null) - sb.append(" (").append(label).append(")"); - return sb.toString(); - } - -} +package org.simantics.db.layer0.variable; + +import org.simantics.databoard.type.Datatype; +import org.simantics.utils.ObjectUtils; + +/** + * @author Tuukka Lehtonen + */ +public class VariableReference { + + public final RVI variableId; + + public final Datatype datatype; + + public String label; + + public static VariableReference of(RVI variableId, Datatype datatype, String label) { + return new VariableReference(variableId, datatype, label); + } + + public VariableReference(RVI variableId, Datatype datatype, String label) { + if (variableId == null) + throw new NullPointerException("null variable reference"); + this.variableId = variableId; + this.datatype = datatype; + this.label = label; + } + + public RVI getVariableId() { + return variableId; + } + + public Datatype getDatatype() { + return datatype; + } + + public String getLabel() { + return label; + } + + @Override + public int hashCode() { + return ObjectUtils.hashCode(datatype) * 31 + variableId.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + VariableReference other = (VariableReference) obj; + return variableId.equals(other.variableId) && ObjectUtils.objectEquals(datatype, other.datatype); +// && ObjectUtils.objectEquals(label, other.label); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(variableId); + if (datatype != null) + sb.append(" : ").append(datatype.toSingleLineString()); + if (label != null) + sb.append(" (").append(label).append(")"); + return sb.toString(); + } + +}