@Override public FieldTypeBuilder type(String valueType) throws RepositoryException, InterruptedException { this.valueType = typeManager.getValueType(valueType); return this; }
@Override public FieldTypeBuilder type(String valueType) throws RepositoryException, InterruptedException { this.valueType = typeManager.getValueType(valueType); return this; }
public ListValueType(TypeManager typeManager, String typeParams) throws RepositoryException, InterruptedException { ArgumentValidator.notNull(typeParams, "typeParams"); this.fullName = NAME+"<"+typeParams+">"; this.valueType = typeManager.getValueType(typeParams); }
public PathValueType(TypeManager typeManager, String typeParams) throws RepositoryException, InterruptedException { ArgumentValidator.notNull(typeParams, "typeParams"); this.fullName = NAME+"<"+typeParams+">"; this.valueType = typeManager.getValueType(typeParams); }
public ValueType convert(AvroValueType valueType, TypeManager typeManager) throws RepositoryException, InterruptedException { return valueType == null ? null : typeManager.getValueType(valueType.getValueType()); }
private FieldType buildFieldType() throws RepositoryException, InterruptedException { if (name == null) { throw new IllegalStateException("Cannot create field type: name not set."); } // Apply defaults if (valueType == null) { valueType = typeManager.getValueType("STRING"); } if (scope == null) { scope = defaultScope; } return typeManager.newFieldType(valueType, name, scope); }
valueType = field.multiValue ? typeManager.getValueType("LIST<"+field.type+">") : typeManager.getValueType(field.type); } catch (RepositoryException e) { throw new RuntimeException(e); // unlikely to occur
public List<MutationCondition> convertFromAvro(List<AvroMutationCondition> avroConditions, LRepository repository) throws RepositoryException, InterruptedException { if (avroConditions == null) { return null; } List<MutationCondition> conditions = new ArrayList<MutationCondition>(avroConditions.size()); for (AvroMutationCondition avroCond : avroConditions) { QName name = convert(avroCond.getName()); // value is optional Object value = null; if (avroCond.getValue() != null) { ValueType valueType = repository.getTypeManager().getValueType(avroCond.getValueType()); value = valueType.read(avroCond.getValue().array()); } CompareOp op = convert(avroCond.getOperator()); boolean allowMissing = avroCond.getAllowMissing(); conditions.add(new MutationCondition(name, op, value, allowMissing)); } return conditions; }
@Override public FieldType create() throws RepositoryException, InterruptedException { FieldType fieldType = buildFieldType(); // Apply defaults if (fieldType.getValueType() == null) { fieldType.setValueType(typeManager.getValueType("STRING")); } if (fieldType.getScope() == null) { fieldType.setScope(Scope.NON_VERSIONED); } return typeManager.createFieldType(fieldType); }
ValueType valueType = typeManager.getValueType(ValueTypeNSConverter.fromJson(valueTypeString, namespaces)); FieldType fieldType = typeManager.newFieldType(valueType, name, scope);
QName name = readQName(input); String valueTypeName = input.readUTF(); ValueType valueType = typeManager.getValueType(valueTypeName); Object value = valueType.read(input); record.setField(name, value);