diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-02-17 18:03:58 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-02-17 18:16:06 +0000 |
commit | 3b26bf26dfe8c4b7343b85251b08f0c7b1a01cdc (patch) | |
tree | 6242b27de270a5a1fa4b9c8b62f174120a3bfb39 /document | |
parent | ccbd4c15ba8562b5f37faf23ebe4c9e1c34c19f1 (diff) |
deprecate modifying types in-place
* instead of modifying a MapDataType or WeightedSetDataType instance
in-place, make a new instance as necessary.
Diffstat (limited to 'document')
-rw-r--r-- | document/src/main/java/com/yahoo/document/CollectionDataType.java | 5 | ||||
-rw-r--r-- | document/src/main/java/com/yahoo/document/MapDataType.java | 12 |
2 files changed, 12 insertions, 5 deletions
diff --git a/document/src/main/java/com/yahoo/document/CollectionDataType.java b/document/src/main/java/com/yahoo/document/CollectionDataType.java index b78f28e8b36..de2aa0cff19 100644 --- a/document/src/main/java/com/yahoo/document/CollectionDataType.java +++ b/document/src/main/java/com/yahoo/document/CollectionDataType.java @@ -41,8 +41,11 @@ public abstract class CollectionDataType extends DataType { protected FieldValue createByReflection(Object arg) { return null; } /** - * Sets the nested type of this CollectionDataType. WARNING! Do not use! Only to be used by config system! + * WARNING! Do not use! Only to be used by config system! + * Sets the nested type of this CollectionDataType. + * @deprecated // TODO Vespa 8 remove */ + @Deprecated(forRemoval = true, since = "7") public void setNestedType(DataType nestedType) { this.nestedType = nestedType; } diff --git a/document/src/main/java/com/yahoo/document/MapDataType.java b/document/src/main/java/com/yahoo/document/MapDataType.java index 335cda7d3ae..97a533def8d 100644 --- a/document/src/main/java/com/yahoo/document/MapDataType.java +++ b/document/src/main/java/com/yahoo/document/MapDataType.java @@ -21,7 +21,6 @@ public class MapDataType extends DataType { super("Map<"+keyType.getName()+","+valueType.getName()+">", id); this.keyType=keyType; this.valueType = valueType; - } public MapDataType(DataType keyType, DataType valueType) { @@ -54,20 +53,25 @@ public class MapDataType extends DataType { } /** - * Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system! + * WARNING! Do not use! Only to be used by config system! + * Sets the key type of this MapDataType. + * @deprecated // TODO Vespa 8 remove */ + @Deprecated(forRemoval = true, since = "7") public void setKeyType(DataType keyType) { this.keyType = keyType; } /** - * Sets the key type of this MapDataType. WARNING! Do not use! Only to be used by config system! + * WARNING! Do not use! Only to be used by config system! + * Sets the value type of this MapDataType. + * @deprecated // TODO Vespa 8 remove */ + @Deprecated(forRemoval = true, since = "7") public void setValueType(DataType valueType) { this.valueType = valueType; } - @Override public MapFieldValue createFieldValue() { return new MapFieldValue(this); |