diff options
-rw-r--r-- | document/abi-spec.json | 2 | ||||
-rw-r--r-- | document/src/main/java/com/yahoo/document/TensorDataType.java | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/document/abi-spec.json b/document/abi-spec.json index b119f9991b3..903b7a897df 100644 --- a/document/abi-spec.json +++ b/document/abi-spec.json @@ -1911,6 +1911,8 @@ "public java.lang.Class getValueClass()", "public boolean isValueCompatible(com.yahoo.document.datatypes.FieldValue)", "public com.yahoo.tensor.TensorType getTensorType()", + "public boolean equals(java.lang.Object)", + "public int hashCode()", "public bridge synthetic com.yahoo.document.DataType clone()", "public bridge synthetic com.yahoo.vespa.objects.Identifiable clone()", "public bridge synthetic java.lang.Object clone()" diff --git a/document/src/main/java/com/yahoo/document/TensorDataType.java b/document/src/main/java/com/yahoo/document/TensorDataType.java index a9624e96b16..c4fdff30f8b 100644 --- a/document/src/main/java/com/yahoo/document/TensorDataType.java +++ b/document/src/main/java/com/yahoo/document/TensorDataType.java @@ -6,6 +6,8 @@ import com.yahoo.document.datatypes.TensorFieldValue; import com.yahoo.tensor.TensorType; import com.yahoo.vespa.objects.Ids; +import java.util.Objects; + /** * A DataType containing a tensor type * @@ -49,4 +51,17 @@ public class TensorDataType extends DataType { /** Returns the type of the tensor this field can hold */ public TensorType getTensorType() { return tensorType; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + TensorDataType that = (TensorDataType) o; + return Objects.equals(tensorType, that.tensorType); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), tensorType); + } } |