@Override public Metadata unmarshall(final InputStream input) throws IOException { Metadata result = (Metadata) ServerMarshalling.fromJSON(input); return result; }
@Override @SuppressWarnings("unchecked") public Graph unmarshall(final Metadata metadata, final InputStream input) throws IOException { Graph result = (Graph) ServerMarshalling.fromJSON(input); return result; }
public static Object fromJSON(final InputStream inputStream) throws IOException { return fromJSON(inputStream, Object.class); } }
public static Object fromJSON(final InputStream inputStream) throws IOException { return fromJSON(inputStream, Object.class); } }
@Override public Object readFrom(final Class<Object> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { if (type.isInterface()) { return ServerMarshalling.fromJSON(entityStream); } return ServerMarshalling.fromJSON(entityStream, type); } }
Object fromJSON(ClusterSerializedCDIMessageWrapper message) { return ServerMarshalling.fromJSON(message.getJson()); }
Object fromJSON(ClusterSerializedCDIMessageWrapper message) { return ServerMarshalling.fromJSON(message.getJson()); }
@Override public <T> T read(final String path) { Path fsPath = fileSystem.getPath(path); try { if (ioService.exists(fsPath)) { String content = ioService.readAllString(fsPath); return (T) ServerMarshalling.fromJSON(content); } } catch (final Exception e) { throw new RuntimeException(e); } return null; }
private void check(final Issue original, final Issue secondOne) { final String json = ServerMarshalling.toJSON(original); final Issue newVersion = (Issue) ServerMarshalling.fromJSON(json); assertEquals(original.hashCode(), newVersion.hashCode()); assertNotEquals(secondOne.hashCode(), newVersion.hashCode()); } }
private void check(final Issue original, final Issue secondOne) { final String json = ServerMarshalling.toJSON(original); final Issue newVersion = (Issue) ServerMarshalling.fromJSON(json); assertEquals(original.hashCode(), newVersion.hashCode()); assertNotEquals(secondOne.hashCode(), newVersion.hashCode()); } }