summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/documentmodel
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-06-16 07:40:42 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-06-16 09:46:17 +0000
commitfcf38c0586e6166ed819a078355502bda4656d01 (patch)
treeba0fca554bccae26a0bdece24e715cc223c02c6a /config-model/src/main/java/com/yahoo/documentmodel
parentc0d8eff2873a2a352b368fe0e616caf812673a33 (diff)
- Removing body struct from our own usage.
- Deprecate public methods using body struct. - Update expected generated config.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/documentmodel')
-rw-r--r--config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java30
1 files changed, 0 insertions, 30 deletions
diff --git a/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java b/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java
index 41a30c4553d..df9f72b2182 100644
--- a/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java
+++ b/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java
@@ -66,7 +66,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
private final Map<Integer, NewDocumentType> inherits = new LinkedHashMap<>();
private final AnnotationTypeRegistry annotations = new AnnotationTypeRegistry();
private final StructDataType header;
- private final StructDataType body;
private final Set<FieldSet> fieldSets = new LinkedHashSet<>();
private final Set<Name> documentReferences;
// Imported fields are virtual and therefore exist outside of the SD's document field definition
@@ -84,7 +83,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
this(
name,
new StructDataType(name.getName() + ".header"),
- new StructDataType(name.getName() + ".body"),
new FieldSets(),
documentReferences,
importedFieldNames);
@@ -96,14 +94,12 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
public NewDocumentType(Name name,
StructDataType header,
- StructDataType body,
FieldSets fs,
Set<Name> documentReferences,
Set<String> importedFieldNames) {
super(name.getName());
this.name = name;
this.header = header;
- this.body = body;
if (fs != null) {
this.fieldSets.addAll(fs.userFieldSets().values());
for (FieldSet f : fs.builtInFieldSets().values()) {
@@ -122,7 +118,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
}
public DataType getHeader() { return header; }
- public DataType getBody() { return body; }
public Collection<NewDocumentType> getInherited() { return inherits.values(); }
public NewDocumentType getInherited(Name inherited) { return inherits.get(inherited.getId()); }
public NewDocumentType removeInherited(Name inherited) { return inherits.remove(inherited.getId()); }
@@ -144,23 +139,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
return ret;
}
- /**
- * Data type of the body fields of this and all inherited document types
- * @return merged {@link StructDataType}
- */
- public StructDataType allBody() {
- StructDataType ret = new StructDataType(body.getName());
- for (Field f : body.getFields()) {
- ret.addField(f);
- }
- for (NewDocumentType inherited : getInherited()) {
- for (Field f : ((StructDataType) inherited.getBody()).getFields()) {
- ret.addField(f);
- }
- }
- return ret;
- }
-
@Override
public Class getValueClass() {
return Document.class;
@@ -219,9 +197,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
public Field getField(String name) {
Field field = header.getField(name);
if (field == null) {
- field = body.getField(name);
- }
- if (field == null) {
for (NewDocumentType inheritedType : inherits.values()) {
field = inheritedType.getField(name);
if (field != null) {
@@ -240,9 +215,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
public Field getField(int id) {
Field field = header.getField(id);
if (field == null) {
- field = body.getField(id);
- }
- if (field == null) {
for (NewDocumentType inheritedType : inherits.values()) {
field = inheritedType.getField(id);
if (field != null) {
@@ -261,14 +233,12 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp
}
collection.addAll(header.getFields());
- collection.addAll(body.getFields());
return Collections.unmodifiableCollection(collection);
}
public Collection<Field> getFields() {
Collection<Field> collection = new LinkedList<>();
collection.addAll(header.getFields());
- collection.addAll(body.getFields());
return Collections.unmodifiableCollection(collection);
}