summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2023-01-23 15:50:44 +0100
committerGitHub <noreply@github.com>2023-01-23 15:50:44 +0100
commita1e2776f0c23553b1ade02b10d3ee8b11020f13e (patch)
tree78aac77d0a081bee58f8908fc38fa5b225e49549 /document
parent9609b36966918ed7e8a58a3b169dd061b15880eb (diff)
parentb73326c490f868d2cc49f8cb4487e742d7dd5c6f (diff)
Merge pull request #25654 from vespa-engine/bratseth/input-fallback
Bratseth/input fallback
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/Document.java26
-rw-r--r--document/src/main/java/com/yahoo/document/update/AssignValueUpdate.java4
2 files changed, 16 insertions, 14 deletions
diff --git a/document/src/main/java/com/yahoo/document/Document.java b/document/src/main/java/com/yahoo/document/Document.java
index 760b9de0199..3dc628e0a90 100644
--- a/document/src/main/java/com/yahoo/document/Document.java
+++ b/document/src/main/java/com/yahoo/document/Document.java
@@ -43,7 +43,7 @@ public class Document extends StructuredFieldValue {
public static final int classId = registerClass(Ids.document + 3, Document.class);
public static final short SERIALIZED_VERSION = 8;
private DocumentId docId;
- private Struct header;
+ private Struct content;
private Long lastModified = null;
/**
@@ -73,7 +73,7 @@ public class Document extends StructuredFieldValue {
*/
public Document(Document doc) {
this(doc.getDataType(), doc.getId());
- header = doc.header;
+ content = doc.content;
lastModified = doc.lastModified;
}
@@ -105,12 +105,12 @@ public class Document extends StructuredFieldValue {
public Document clone() {
Document doc = (Document) super.clone();
doc.docId = docId.clone();
- doc.header = header.clone();
+ doc.content = content.clone();
return doc;
}
private void setNewType(DocumentType type) {
- header = type.contentStruct().createFieldValue();
+ content = type.contentStruct().createFieldValue();
}
public void setDataType(DataType type) {
@@ -163,7 +163,7 @@ public class Document extends StructuredFieldValue {
@Override
public Field getField(String fieldName) {
- Field field = header.getField(fieldName);
+ Field field = content.getField(fieldName);
if (field == null) {
for(DocumentType parent : getDataType().getInheritedTypes()) {
field = parent.getField(fieldName);
@@ -177,27 +177,27 @@ public class Document extends StructuredFieldValue {
@Override
public FieldValue getFieldValue(Field field) {
- return header.getFieldValue(field);
+ return content.getFieldValue(field);
}
@Override
protected void doSetFieldValue(Field field, FieldValue value) {
- header.setFieldValue(field, value);
+ content.setFieldValue(field, value);
}
@Override
public FieldValue removeFieldValue(Field field) {
- return header.removeFieldValue(field);
+ return content.removeFieldValue(field);
}
@Override
public void clear() {
- header.clear();
+ content.clear();
}
@Override
public Iterator<Map.Entry<Field, FieldValue>> iterator() {
- return header.iterator();
+ return content.iterator();
}
public String toString() {
@@ -244,7 +244,7 @@ public class Document extends StructuredFieldValue {
if (o == this) return true;
if (!(o instanceof Document other)) return false;
return (super.equals(o) && docId.equals(other.docId) &&
- header.equals(other.header));
+ content.equals(other.content));
}
@Override
@@ -289,7 +289,7 @@ public class Document extends StructuredFieldValue {
@Override
public int getFieldCount() {
- return header.getFieldCount();
+ return content.getFieldCount();
}
public void serialize(DocumentWriter writer) {
@@ -329,7 +329,7 @@ public class Document extends StructuredFieldValue {
return comp;
}
- comp = header.compareTo(otherValue.header);
+ comp = content.compareTo(otherValue.content);
if (comp != 0) {
return comp;
diff --git a/document/src/main/java/com/yahoo/document/update/AssignValueUpdate.java b/document/src/main/java/com/yahoo/document/update/AssignValueUpdate.java
index 0797db5772f..9b1fdc647eb 100644
--- a/document/src/main/java/com/yahoo/document/update/AssignValueUpdate.java
+++ b/document/src/main/java/com/yahoo/document/update/AssignValueUpdate.java
@@ -8,9 +8,10 @@ import com.yahoo.document.serialization.DocumentUpdateWriter;
/**
* <p>Value update that represents assigning a new value.</p>
*
- * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
+ * @author Einar M R Rosenvinge
*/
public class AssignValueUpdate extends ValueUpdate {
+
protected FieldValue value;
public AssignValueUpdate(FieldValue value) {
@@ -84,4 +85,5 @@ public class AssignValueUpdate extends ValueUpdate {
public String toString() {
return super.toString() + " " + value;
}
+
}