Package com.cloudera.api

Examples of com.cloudera.api.ApiObjectMapper.readValue()


  }

  static <T> T jsonToObject(String text, Class<T> type)
      throws IOException {
    ApiObjectMapper objectMapper = new ApiObjectMapper();
    return objectMapper.readValue(text, type);
  }


  private static <T> void checkJson(Class<? extends T> type, T object)
      throws IOException {
View Full Code Here


      // Check that the encoded property matches the convention for our lists.
      String json = objectToJson(lst);

      ApiObjectMapper mapper = new ApiObjectMapper();
      @SuppressWarnings("unchecked")
      Map<String, Object> map = mapper.readValue(json, Map.class);
      assertTrue("List " + lst.getClass().getName() + " has wrong 'items' property.",
          map.containsKey(ApiListBase.ITEMS_ATTR));
    }
  }
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.