@Test public void deserializeTest() throws IOException { String json = "[64, 25349185, {}, \"com.myapp.myprocedure\"]"; RegisterMessage registerMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(registerMessage.getCode()).isEqualTo(64); assertThat(registerMessage.getRequestId()).isEqualTo(25349185L); assertThat(registerMessage.getProcedure()).isEqualTo("com.myapp.myprocedure"); assertThat(registerMessage.isDiscloseCaller()).isFalse(); json = "[64, 927639114088448, {\"disclose_caller\":true},\"com.maypp.add2\"]"; registerMessage = WampMessage.deserialize(getJsonFactory(), json.getBytes(StandardCharsets.UTF_8)); assertThat(registerMessage.getCode()).isEqualTo(64); assertThat(registerMessage.getRequestId()).isEqualTo(927639114088448L); assertThat(registerMessage.getProcedure()).isEqualTo("com.maypp.add2"); assertThat(registerMessage.isDiscloseCaller()).isTrue(); }
public static RegisterMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); boolean discloseCaller = false; jp.nextToken(); Map<String, Object> options = ParserUtil.readObject(jp); if (options != null) { discloseCaller = (boolean) options.getOrDefault("disclose_caller", false); } jp.nextToken(); String procedure = jp.getValueAsString(); return new RegisterMessage(request, procedure, discloseCaller); }
RegisterMessage extends WampMessage { public static RegisterMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); boolean discloseCaller = false; jp.nextToken(); Map<String, Object> options = ParserUtil.readObject(jp); if (options != null) { discloseCaller = (boolean) options.getOrDefault("disclose_caller", false); } jp.nextToken(); String procedure = jp.getValueAsString(); return new RegisterMessage(request, procedure, discloseCaller); } }
RegisterMessage extends WampMessage { public static RegisterMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); boolean discloseCaller = false; jp.nextToken(); Map<String, Object> options = ParserUtil.readObject(jp); if (options != null) { discloseCaller = (boolean) options.getOrDefault("disclose_caller", false); } jp.nextToken(); String procedure = jp.getValueAsString(); return new RegisterMessage(request, procedure, discloseCaller); } RegisterMessage(long requestId, String procedure);  RegisterMessage(long requestId, String procedure, boolean discloseCaller); }
RegisterMessage extends WampMessage { public static RegisterMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); boolean discloseCaller = false; jp.nextToken(); Map<String, Object> options = ParserUtil.readObject(jp); if (options != null) { discloseCaller = (boolean) options.getOrDefault("disclose_caller", false); } jp.nextToken(); String procedure = jp.getValueAsString(); return new RegisterMessage(request, procedure, discloseCaller); } RegisterMessage(long requestId, String procedure);  RegisterMessage(long requestId, String procedure, boolean discloseCaller); static RegisterMessage deserialize(JsonParser jp); @Override void serialize(JsonGenerator generator); long getRequestId(); String getProcedure(); boolean isDiscloseCaller(); @Override String toString(); }
RegisterMessage extends WampMessage { public static RegisterMessage deserialize(JsonParser jp) throws IOException { jp.nextToken(); long request = jp.getLongValue(); boolean discloseCaller = false; jp.nextToken(); Map<String, Object> options = ParserUtil.readObject(jp); if (options != null) { discloseCaller = (boolean) options.getOrDefault("disclose_caller", false); } jp.nextToken(); String procedure = jp.getValueAsString(); return new RegisterMessage(request, procedure, discloseCaller); } RegisterMessage(long requestId, String procedure);  RegisterMessage(long requestId, String procedure, boolean discloseCaller); static RegisterMessage deserialize(JsonParser jp); @Override void serialize(JsonGenerator generator); long getRequestId(); String getProcedure(); boolean isDiscloseCaller(); @Override String toString(); static final int CODE; }