Package com.linkedin.data.template

Examples of com.linkedin.data.template.RecordTemplate.schema()


  public static ComplexResourceKey<?, ?> fixUpComplexKeySingletonArray(ComplexResourceKey<?,?> complexResourceKey)
  {
    RecordTemplate key = complexResourceKey.getKey();
    DataMap dataMap = key.data();

    for (RecordDataSchema.Field f : key.schema().getFields())
    {
      DataSchema.Type type = f.getType().getType();
      String fieldName = f.getName();

      if (type == DataSchema.Type.ARRAY && dataMap.containsKey(fieldName))
View Full Code Here


    RecordTemplate recordTemplate = wrapWithSchema(dataMap, spec);
    // Validate against the class schema with FixupMode.STRING_TO_PRIMITIVE to parse the
    // strings into the
    // corresponding primitive types.
    ValidateDataAgainstSchema.validate(recordTemplate.data(),
                                       recordTemplate.schema(),
                                       new ValidationOptions(RequiredMode.CAN_BE_ABSENT_IF_HAS_DEFAULT,
                                                             CoercionMode.STRING_TO_PRIMITIVE));
    return recordTemplate;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.