aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-05-18 17:55:29 +0200
committerGitHub <noreply@github.com>2024-05-18 17:55:29 +0200
commit8d43cf96c49c1d0c3ef6b64a937a97003f60cfc2 (patch)
treeb282c7799caa11ffb6548020e6d3b00517bac71b
parentdf63f924906c7c3199b812468d6097ebbe20c60f (diff)
parentc6773d4c217a11de5649bcaaacc074e6e4774341 (diff)
Merge pull request #31236 from vespa-engine/balder/fieldview-contains-fieldbase
It is sufficient for a fieldview to contains collection of FieldBase.
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/documentmodel/FieldView.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/documentmodel/FieldView.java b/config-model/src/main/java/com/yahoo/vespa/documentmodel/FieldView.java
index edc25bd8246..7034365c40b 100644
--- a/config-model/src/main/java/com/yahoo/vespa/documentmodel/FieldView.java
+++ b/config-model/src/main/java/com/yahoo/vespa/documentmodel/FieldView.java
@@ -1,7 +1,7 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.documentmodel;
-import com.yahoo.document.Field;
+import com.yahoo.vespa.objects.FieldBase;
import java.io.Serializable;
import java.util.Collection;
@@ -14,7 +14,7 @@ import java.util.Map;
public class FieldView implements Serializable {
private final String name;
- private final Map<String, Field> fields = new LinkedHashMap<>();
+ private final Map<String, FieldBase> fields = new LinkedHashMap<>();
/**
* Creates a view with a name
@@ -24,8 +24,8 @@ public class FieldView implements Serializable {
this.name = name;
}
public String getName() { return name; }
- public Collection<Field> getFields() { return fields.values(); }
- public Field get(String name) { return fields.get(name); }
+ public Collection<FieldBase> getFields() { return fields.values(); }
+ public FieldBase get(String name) { return fields.get(name); }
public void remove(String name) { fields.remove(name); }
/**
@@ -34,7 +34,7 @@ public class FieldView implements Serializable {
* @param field the field to add.
* @return itself for chaining purposes.
*/
- public FieldView add(Field field) {
+ public FieldView add(FieldBase field) {
if (fields.containsKey(field.getName())) {
if ( ! fields.get(field.getName()).equals(field)) {
throw new IllegalArgumentException(
@@ -54,7 +54,7 @@ public class FieldView implements Serializable {
* @return Itself for chaining.
*/
public FieldView add(FieldView view) {
- for(Field field : view.getFields()) {
+ for(var field : view.getFields()) {
add(field);
}
return this;