use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerSinglePositionDocumentType.
private void registerSinglePositionDocumentType() {
DocumentType x = new DocumentType("testsinglepos");
DataType d = PositionDataType.INSTANCE;
x.addField(new Field("singlepos", d));
types.registerDocumentType(x);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class JsonWriterTestCase method registerRawDocumentType.
private void registerRawDocumentType() {
DocumentType x = new DocumentType("testraw");
DataType d = DataType.RAW;
x.addField(new Field("actualraw", d));
types.registerDocumentType(x);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class PredicateFieldValueTest method requireThatSerializeCallsBackToWriter.
@Test
public void requireThatSerializeCallsBackToWriter() {
Field field = Mockito.mock(Field.class);
FieldWriter writer = Mockito.mock(FieldWriter.class);
PredicateFieldValue value = new PredicateFieldValue(SimplePredicates.newPredicate());
value.serialize(field, writer);
Mockito.verify(writer).write(field, value);
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class ReferenceFieldValueTestCase method createDocumentType.
private static DocumentType createDocumentType(String name) {
DocumentType type = new DocumentType(name);
type.addField(new Field("foo", DataType.STRING));
return type;
}
use of com.yahoo.document.Field in project vespa by vespa-engine.
the class StringTestCase method getAnnotationsForNode.
public void getAnnotationsForNode(SpanTree tree, SpanNode node) {
Iterator<Annotation> iter = tree.iterator(node);
boolean annotationPresent = false;
while (iter.hasNext()) {
annotationPresent = true;
Annotation xx = iter.next();
Struct fValue = (Struct) xx.getFieldValue();
System.out.println("Annotation: " + xx);
if (fValue == null) {
System.out.println("Field Value is null");
return;
}
Iterator fieldIter = fValue.iterator();
while (fieldIter.hasNext()) {
Map.Entry m = (Map.Entry) fieldIter.next();
Field f = (Field) m.getKey();
FieldValue val = (FieldValue) m.getValue();
System.out.println("Field : " + f + " Value: " + val);
}
}
if (!annotationPresent) {
System.out.println("****No annotations found for the span node: " + node);
}
}
Aggregations