@Test public void test_deserialize_request() { DiagnosticRequest request = new DiagnosticRequest(Closeable.class, "prepareDiner()"); assertThat(codec.deserialize(jsonFile("/output1.json"), DiagnosticRequest.class), is(equalTo(request))); }
@Override public <T> T deserialize(String json, Class<T> target) throws DiagnosticCodecException { requireNonNull(json); requireNonNull(target); try { return JsonNode.class.isAssignableFrom(target) ? target.cast(objectMapper.readTree(json)) : objectMapper.readValue(json, target); } catch (IOException | RuntimeException e) { throw new DiagnosticCodecException(e); } }
JsonDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String json, Class<T> target) throws DiagnosticCodecException { requireNonNull(json); requireNonNull(target); try { return JsonNode.class.isAssignableFrom(target) ? target.cast(objectMapper.readTree(json)) : objectMapper.readValue(json, target); } catch (IOException | RuntimeException e) { throw new DiagnosticCodecException(e); } } }
JsonDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String json, Class<T> target) throws DiagnosticCodecException { requireNonNull(json); requireNonNull(target); try { return JsonNode.class.isAssignableFrom(target) ? target.cast(objectMapper.readTree(json)) : objectMapper.readValue(json, target); } catch (IOException | RuntimeException e) { throw new DiagnosticCodecException(e); } } JsonDiagnosticCodec(ObjectMapperFactory objectMapperFactory); }
JsonDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String json, Class<T> target) throws DiagnosticCodecException { requireNonNull(json); requireNonNull(target); try { return JsonNode.class.isAssignableFrom(target) ? target.cast(objectMapper.readTree(json)) : objectMapper.readValue(json, target); } catch (IOException | RuntimeException e) { throw new DiagnosticCodecException(e); } } JsonDiagnosticCodec(ObjectMapperFactory objectMapperFactory); @Override String serialize(Object o); @Override T deserialize(String json, Class<T> target); @Override String toString(); }
JsonDiagnosticCodec extends DiagnosticCodecSkeleton<String> { @Override public <T> T deserialize(String json, Class<T> target) throws DiagnosticCodecException { requireNonNull(json); requireNonNull(target); try { return JsonNode.class.isAssignableFrom(target) ? target.cast(objectMapper.readTree(json)) : objectMapper.readValue(json, target); } catch (IOException | RuntimeException e) { throw new DiagnosticCodecException(e); } } JsonDiagnosticCodec(ObjectMapperFactory objectMapperFactory); @Override String serialize(Object o); @Override T deserialize(String json, Class<T> target); @Override String toString();  }