Package com.linkedin.data

Examples of com.linkedin.data.DataList


            resultMap.put(key, entryAvroValue);
          }
          result = resultMap;
          break;
        case ARRAY:
          DataList list = (DataList) value;
          DataList resultList = new DataList(list.size());
          DataSchema elementDataSchema = ((ArrayDataSchema) dataSchema).getItems();
          for (int i = 0; i < list.size(); i++)
          {
            path.add(i);
            Object entryAvroValue = translate(path, list.get(i), elementDataSchema);
            path.remove(path.size() - 1);
            resultList.add(entryAvroValue);
          }
          result = resultList;
          break;
        case RECORD:
          DataMap recordMap = (DataMap) value;
View Full Code Here


  {
    DataObjectToObjectCache<DataTemplate<?>> testCache = new DataObjectToObjectCache<DataTemplate<?>>();

    Assert.assertNull(testCache.get(new Object()));
    Assert.assertNull(testCache.get(new DataMap()));
    Assert.assertNull(testCache.get(new DataList()));
  }
View Full Code Here

  @Test
  public void testValueOverwrite()
  {
    DataObjectToObjectCache<DataTemplate<?>> testCache = new DataObjectToObjectCache<DataTemplate<?>>();
    DataMap mapKey = new DataMap();
    DataList listKey = new DataList();
    Object objKey = new Object();

    testCache.put(mapKey, new Bar());
    testCache.put(listKey, new Bar());
    testCache.put(objKey, new Bar());
View Full Code Here

                                DataObjectToObjectCache<DataTemplate<?>> testCache)
  {
    for (int i=0; i<100; ++i)
    {
      DataMap map = new DataMap();
      DataList list = new DataList();
      Object obj = new Object();
      Bar mapBar = new Bar();
      Bar listBar = new Bar();
      Bar objBar = new Bar();
View Full Code Here

      foo.removeBoolean();
      assertFalse(foo.hasBoolean());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(3, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      foo.removeEnum();
      assertFalse(foo.hasEnum());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      foo.removeInt();
      assertFalse(foo.hasInt());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      foo.removeLong();
      assertFalse(foo.hasLong());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      foo.removeFloat();
      assertFalse(foo.hasFloat());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
View Full Code Here

      foo.removeDouble();
      assertFalse(foo.hasDouble());
      assertEquals(foo.toString(), "{}");
    }

    List<?> badInput = TestUtil.asList(false, "abc", new DataList());

    DataMap map = new DataMap();
    foo = new Foo(map);
    for (Object bad : badInput)
    {
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.