Package com.linkedin.data

Examples of com.linkedin.data.DataList


  {
    SimpleTestData data = IteratorTestData.createSimpleTestData();
   
    Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
    .filterBy(Predicates.nameEquals("foo"))
    .replace(new DataList());
   
    assertEquals(Builder.create(data.getDataElement(), IterationOrder.PRE_ORDER)
      .filterBy(Predicates.pathMatchesPathSpec(new PathSpec("nested", "nested", "foo", PathSpec.WILDCARD)))
      .count(), 0);
   
View Full Code Here


    Assert.assertSame(result.getClass(), TestArrayTemplate.FooRecord[].class);
  }

  private static Object convert(String listString, Class<?> targetClass) throws IOException
  {
    final DataList list = _codec.stringToList(listString);
    return DataTemplateUtil.convertDataListToArray(list, targetClass.getComponentType());
  }
View Full Code Here

        "{\"long1\":12,\"int\":1,\"union\":{\"Foo\":{\"long1\":12,\"int\":1,\"long\":12,\"double\":2.0,\"double1\":3.0,\"float\":3.0}},\"double1\":3.0}",
        "{\"int\":1,\"union\":{\"Foo\":{\"int\":1,\"long\":12,\"float\":3.0,\"double\":2.0,\"double1\":3.0,\"long1\":12}},\"double1\":3.0,\"long1\":12}"
      },
      {
        // empty record array
        asMap("int", 1, "recordArray", new DataList(), "long1", 12L, "double1", 3.0),
        "{\"long1\":12,\"int\":1,\"double1\":3.0,\"recordArray\":[]}",
        "{\"int\":1,\"recordArray\":[],\"double1\":3.0,\"long1\":12}"
      },
      { // non-empty record array
        asMap("int", 1, "recordArray", new DataList(asList(new DataMap(asMap("int",
                                                                             1,
                                                                             "long",
                                                                             12L,
                                                                             "float",
                                                                             3.0f,
View Full Code Here

      }
    };

    for (Object[] row : inputs)
    {
      @SuppressWarnings("unchecked")
      DataList list = new DataList((List<Object>) row[0]);
      FooArray fooArray = new FooArray(list);
      String noOrder = templateToString(fooArray, false);
      String order = templateToString(fooArray, true);
      /* out.println(noOrder);
      out.println(order);
View Full Code Here

  public static class FooArray extends WrappingArrayTemplate<Foo>
  {
    public static final ArrayDataSchema SCHEMA = (ArrayDataSchema) Foo.FIELD_arrayRecord.getType();
    public FooArray()
    {
      this(new DataList());
    }
View Full Code Here

    {
      this(new DataList());
    }
    public FooArray(int capacity)
    {
      this(new DataList(capacity));
    }
View Full Code Here

    {
      this(new DataList(capacity));
    }
    public FooArray(Collection<Foo> c)
    {
      this(new DataList(c.size()));
      addAll(c);
    }
View Full Code Here

  @Test
  public void testCustomPointArray()
  {
    final List<String> input = new ArrayList<String>(Arrays.asList("1,1", "2,2", "3,3"));
    final DataList inputDataList = new DataList(input);

    CustomPointArray a1 = new CustomPointArray();
    for (String s : input)
    {
      a1.add(new CustomPoint(s));
View Full Code Here

  }

  @Test
  public void testNoSchemaDataListRoot()
  {
    DataList root = new DataList();
    root.add(false);
    root.add(1);
    root.add(2L);
    root.add(3.0f);
    root.add(4.0);
    root.add("foo");
    root.add(ByteString.copyAvroString("abc", false));

    String preExpected =
      "name=" + DataElement.ROOT_NAME + ", class=com.linkedin.data.DataList\n" +
      " name=0, class=java.lang.Boolean, value=false\n" +
      " name=1, class=java.lang.Integer, value=1\n" +
View Full Code Here

    int internalFanout = 4;

    DataMap root = new DataMap();
    for (int i = 0; i < internalFanout; ++i)
    {
      DataList level1 = new DataList();
      root.put("list_" + i, level1);
      for (int j = 0; j < internalFanout; ++j)
      {
        DataMap level2 = new DataMap();
        level1.add(level2);
        for (int k = 0; k < leafFanout; ++k)
        {
          level2.put("key_" + i + "_" + j + "_" + k, "value_" + k);
        }
      }
View Full Code Here

TOP

Related Classes of com.linkedin.data.DataList

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.