blob: 094be71918b0f4edbf6f86cd1dc0fa7082327da9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.datatypes;
import com.yahoo.document.DataType;
public abstract class CompositeFieldValue extends FieldValue {
private DataType dataType;
public CompositeFieldValue(DataType dataType) {
this.dataType = dataType;
}
@Override
public DataType getDataType() {
return dataType;
}
public void setDataType(DataType dataType) {
this.dataType = dataType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof CompositeFieldValue)) return false;
if (!super.equals(o)) return false;
CompositeFieldValue that = (CompositeFieldValue) o;
if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
return true;
}
@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
return result;
}
}
|