@Override public String toString() { return "FieldTypeImpl [" + "id=" + id + ", valueType=" + (valueType != null ? valueType.getName() : "null") + ", name=" + name + ", scope=" + scope + ']'; } }
public static byte[] encodeValueType(ValueType valueType) { return encodeValueType(valueType.getName()); }
@Override public List<String> format(List<IndexValue> indexValues, LRepository repository) throws InterruptedException { List<String> result = new ArrayList<String>(); for (IndexValue indexValue : indexValues) { ValueType valueType = indexValue.fieldType.getValueType(); if (valueType.getBaseName().equals("LIST")) { // The values of the first list-level are supplied as individual IndexValues valueType = valueType.getNestedValueType(); } if (!valueType.getName().equals("STRING")) { throw new RuntimeException(this.getClass().getSimpleName() + " only supports string values, but got: " + valueType.getName()); } processPath((String)indexValue.value, result); } return result; }
public AvroValueType convert(ValueType valueType) { if (valueType == null) { return null; } AvroValueType avroValueType = new AvroValueType(); avroValueType.setValueType(valueType.getName()); return avroValueType; }
private Follow processFieldDeref(Element fieldEl, String derefPart) throws IndexerConfException, InterruptedException, RepositoryException { FieldType followField = ConfUtil.getFieldType(derefPart, fieldEl, systemFields, typeManager); String type = followField.getValueType().getBaseName(); if (type.equals("LIST")) { type = followField.getValueType().getNestedValueType().getBaseName(); } if (type.equals("RECORD")) { return new RecordFieldFollow(followField); } else if (type.equals("LINK")) { return new LinkFieldFollow(followField); } else { throw new IndexerConfException("Dereferencing is not possible on field of type " + followField.getValueType().getName() + ". Field: '" + derefPart); } }
public static ObjectNode toJson(FieldType fieldType, Namespaces namespaces, boolean includeName) { ObjectNode fieldNode = JsonNodeFactory.instance.objectNode(); fieldNode.put("id", fieldType.getId().toString()); if (includeName) { fieldNode.put("name", QNameConverter.toJson(fieldType.getName(), namespaces)); } fieldNode.put("scope", fieldType.getScope().toString().toLowerCase()); fieldNode.put("valueType", ValueTypeNSConverter.toJson(fieldType.getValueType().getName(), namespaces)); return fieldNode; } }
output.writeUTF(valueType.getName()); try { valueType.write(entry.getValue(), output, new IdentityRecordStack());
+ "that does not support comparison: " + valueType.getName());
private static void printFieldType(Pair<FieldTypeEntry, FieldType> pair, PrintStream out, int indent) { FieldTypeEntry fieldTypeEntry = pair.getV1(); FieldType fieldType = pair.getV2(); println(out, indent, "Name = " + fieldType.getName()); println(out, indent, "ID = " + fieldType.getId()); println(out, indent, "Mandatory = " + fieldTypeEntry.isMandatory()); try { println(out, indent, "ValueType = " + fieldType.getValueType().getName()); } catch (Throwable t) { // value type failed to load } }
if (!typePattern.matches(fieldType.getValueType().getName())) { match.match = false; return match;
avroCond.setValueType(valueType.getName());