Package com.cloudera.api

Examples of com.cloudera.api.ApiObjectMapper


    Object res = um.unmarshal(bais);
    return type.cast(res);
  }

  static String objectToJson(Object object) throws IOException {
    ApiObjectMapper objectMapper = new ApiObjectMapper();
    return objectMapper.writeValueAsString(object);
  }
View Full Code Here


    return objectMapper.writeValueAsString(object);
  }

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

      checkJsonXML(lst);

      // 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

      }
      if (enableLogging) {
         bean.setFeatures(Arrays.<AbstractFeature> asList(new LoggingFeature()));
      }
      bean.setResourceClass(proxyType);
      bean.setProvider(new JacksonJsonProvider(new ApiObjectMapper()));

      T rootResource = bean.create(proxyType);
      ClientConfiguration config = WebClient.getConfig(rootResource);
      HTTPConduit conduit = (HTTPConduit) config.getConduit();
      if (isTlsEnabled) {
View Full Code Here

TOP

Related Classes of com.cloudera.api.ApiObjectMapper

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.