aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-01-20 15:57:51 +0100
committerBjørn Christian Seime <bjorncs@yahoo-inc.com>2017-01-23 13:21:31 +0100
commitb79aaf1245991484c1cdc1f74709c551503407d9 (patch)
tree07a40062589a004d154d958e3b2631f5e1b5f151 /config-model
parent5b1612e17a3cc1030e788ba2e99b0ee567f6ab69 (diff)
Add AST type for reference field
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/document/TemporaryReferenceField.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/TemporaryReferenceField.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/TemporaryReferenceField.java
new file mode 100644
index 00000000000..0568019f722
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/TemporaryReferenceField.java
@@ -0,0 +1,41 @@
+package com.yahoo.searchdefinition.document;
+
+import com.yahoo.document.DataType;
+import com.yahoo.document.TemporaryStructuredDataType;
+import com.yahoo.document.datatypes.FieldValue;
+
+/**
+ * @author bjorncs
+ */
+public class TemporaryReferenceField extends DataType {
+
+ private final TemporaryStructuredDataType referencedDocument;
+
+ public TemporaryReferenceField(TemporaryStructuredDataType referencedDocument) {
+ super(createName(referencedDocument), 0);
+ this.referencedDocument = referencedDocument;
+ }
+
+ private static String createName(TemporaryStructuredDataType referenceType) {
+ return "reference<" + referenceType.getName() + ">";
+ }
+
+ public TemporaryStructuredDataType getReferencedDocument() {
+ return referencedDocument;
+ }
+
+ @Override
+ public FieldValue createFieldValue() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Class getValueClass() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isValueCompatible(FieldValue value) {
+ throw new UnsupportedOperationException();
+ }
+}