@Override public String marshall(final Metadata metadata) throws IOException { String result = ServerMarshalling.toJSON(metadata); return result; } }
String securityContextJson(final User user) { final String userJson = ServerMarshalling.toJSON(user); return "{\"" + SecurityConstants.DICTIONARY_USER + "\": " + userJson + "}"; }
String toJSON(Object event) { return ServerMarshalling.toJSON(event); }
String toJSON(Object event) { return ServerMarshalling.toJSON(event); }
@Override public void writeTo(final Object t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { entityStream.write(ServerMarshalling.toJSON(t).getBytes(Charset.forName("UTF-8"))); }
@Override @SuppressWarnings("unchecked") public String marshall(final Diagram<Graph, Metadata> diagram) throws IOException { String result = ServerMarshalling.toJSON(diagram.getGraph()); return result; }
@Override public <T> void write(final String path, final T value) { try { ioService.startBatch(fileSystem); Path fsPath = fileSystem.getPath(path); String content = ServerMarshalling.toJSON(value); ioService.write(fsPath, content); } catch (final Exception e) { throw new RuntimeException(e); } finally { ioService.endBatch(); } }
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()); } }