spotify/styx · Json.java
java logo
public static <T> T deserialize(ByteString json, Class<T> clazz) throws IOException {
    return OBJECT_MAPPER.readValue(json.toByteArray(), clazz);
  }
Similar code snippets
1.
cloudant/sync-android · JSONUtils.java
Match rating: 68.31% · See similar code snippets
java logo
public static <T> T deserialize(byte[] json, Class<T> clazz) {
        try {
            return getsMapper().readValue(json, clazz);
        } catch (Exception e) {
            throw new IllegalStateException("Error converting byte[] to object: " +
                    bytesToString(json));
        }
    }
2.
duracloud/duracloud · JaxbJsonSerializer.java
Match rating: 67.88% · See similar code snippets
java logo
public T deserialize(String json) throws IOException {
        return (T) mapper.readValue(json, type);
    }
3.
signalapp/libsignal-service-java · JsonUtil.java
Match rating: 67.76% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<T> clazz)
      throws IOException
  {
    return objectMapper.readValue(json, clazz);
  }
4.
hawkular/hawkular-commons · JsonUtil.java
Match rating: 66.55% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<T> clazz) {
        try {
            return MAPPER.readValue(json, clazz);
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }
5.
spotify/styx · Json.java
Match rating: 64.3% · See similar code snippets
java logo
public static Event deserializeEvent(ByteString json) throws IOException {
    return OBJECT_MAPPER.readValue(json.toByteArray(), Event.class);
  }
6.
deeplearning4j/deeplearning4j · JsonMapper.java
Match rating: 63.78% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<? extends T> type){
        try{
            return getMapper().readValue(json, type);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
7.
Multifarious/MacroManager · JsonUtil.java
Match rating: 63.68% · See similar code snippets
java logo
public static <T> T fromJSON(String json, Class<T> cls) throws IOException {
        return MAPPER.readValue(json, cls);
    }
8.
Netflix/conductor · CassandraBaseDAO.java
Match rating: 63.6% · See similar code snippets
java logo
<T> T readValue(String json, Class<T> clazz) {
        try {
            return objectMapper.readValue(json, clazz);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
9.
hawkular/hawkular-agent · Util.java
Match rating: 63.22% · See similar code snippets
java logo
public static <T> T fromJson(String json, Class<T> clazz) {
        final T obj;
        try {
            obj = mapper.readValue(json, clazz);
        } catch (IOException e) {
            throw new IllegalArgumentException("JSON message cannot be converted to object of type:" + clazz, e);
        }
        return obj;
    }
10.
electrumpayments/service-interface-base · JsonUtil.java
Match rating: 63.14% · See similar code snippets
java logo
@SuppressWarnings("unchecked")
   public static <T> T deserialize(String jsonStr, Class<T> clazz) throws IOException {
      if (jsonStr == null) {
         return null;
      }

      ObjectReader reader = getObjectReader(clazz);

      return (T) reader.readValue(jsonStr);
   }