Package com.linkedin.data.schema

Examples of com.linkedin.data.schema.ArrayDataSchema


  {
    super(data, null);
    _elementClass = elementClass;
    StringBuilder errorMessageBuilder = new StringBuilder(10);
    Name elementSchemaName = new Name(elementClass.getSimpleName());
    _arraySchema = new ArrayDataSchema(new RecordDataSchema(elementSchemaName, RecordDataSchema.RecordType.RECORD));
    _arrayField = new RecordDataSchema.Field(_arraySchema);
    _arrayField.setName(ELEMENTS, errorMessageBuilder);

    if (data().get(ELEMENTS) == null)
    {
View Full Code Here


  public void testIntegerArray()
  {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "intArray");
    @SuppressWarnings("unchecked")
    Class<IntegerArray> templateClass = (Class<IntegerArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<Integer> input = Arrays.asList(1, 3, 5, 7, 9); // must be unique
    List<Integer> adds = Arrays.asList(11, 13);

    TestArrayTemplate.testArray(templateClass, schema, input, adds);
View Full Code Here

  public void testStringMapArray()
  {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "stringMapArray");
    @SuppressWarnings("unchecked")
    Class<StringMapArray> templateClass = (Class<StringMapArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<StringMap> input = new ArrayList<StringMap>();
    for (int i = 0; i < 5; ++i)
    {
      input.add(new StringMap());
View Full Code Here

  public void testStringArrayArray()
  {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "stringArrayArray");
    @SuppressWarnings("unchecked")
    Class<StringArrayArray> templateClass = (Class<StringArrayArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<StringArray> input = new ArrayList<StringArray>();
    for (int i = 0; i < 5; ++i)
    {
      input.add(new StringArray());
View Full Code Here

  public void testEnumFruitsArray()
  {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "enumFruitsArray");
    @SuppressWarnings("unchecked")
    Class<EnumFruitsArray> templateClass = (Class<EnumFruitsArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<EnumFruits> input = Arrays.asList(EnumFruits.APPLE, EnumFruits.ORANGE, EnumFruits.BANANA); // must be unique
    List<EnumFruits> adds = Arrays.asList(EnumFruits.GRAPES, EnumFruits.PINEAPPLE);

    TestArrayTemplate.testArray(templateClass, schema, input, adds);
View Full Code Here

  public void testRecordArray()
  {
    TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new ArrayTest(), "recordArray");
    @SuppressWarnings("unchecked")
    Class<RecordBarArray> templateClass = (Class<RecordBarArray>) fieldInfo.getFieldClass();
    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<RecordBar> input = new ArrayList<RecordBar>();
    for (int i = 0; i < 5; ++i)
    {
      input.add(new RecordBar());
View Full Code Here

TOP

Related Classes of com.linkedin.data.schema.ArrayDataSchema

Copyright © 2018 www.massapicom. 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.