@Test public void testDebugString() { assertEquals("{\n" + " operator = MULTIPLY\n" + " operands = [\n" + " {\n" + " operation = {\n" + " operator = ADD\n" + " operands = [\n" + " {\n" + " number = 1234\n" + " },\n" + " {\n" + " number = 4.321\n" + " }\n" + " ]\n" + " }\n" + " },\n" + " {\n" + " imaginary = {\n" + " v = 1.7\n" + " i = -2\n" + " }\n" + " }\n" + " ]\n" + "}", ProvidenceHelper.debugString(mOperation)); }
@Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> String debugString(Message message) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEBUG_STRING_SERIALIZER.serialize(baos, message); return new String(baos.toByteArray(), UTF_8); }
ProvidenceHelper { @Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> String debugString(Message message) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEBUG_STRING_SERIALIZER.serialize(baos, message); return new String(baos.toByteArray(), UTF_8); } }
ProvidenceHelper { @Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> String debugString(Message message) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEBUG_STRING_SERIALIZER.serialize(baos, message); return new String(baos.toByteArray(), UTF_8); } private  ProvidenceHelper(); }
ProvidenceHelper { @Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> String debugString(Message message) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEBUG_STRING_SERIALIZER.serialize(baos, message); return new String(baos.toByteArray(), UTF_8); } private  ProvidenceHelper(); @SuppressWarnings("unchecked") static B getTargetModifications(M source, M target); @Nonnull static Message fromJsonResource(String path,
                             PMessageDescriptor<Message, Field> descriptor); @Nonnull static ArrayList<Message> arrayListFromJsonResource(String path,
                                                 PMessageDescriptor<Message, Field> descriptor); @Nonnull static Message fromResource(String resource,
                         PMessageDescriptor<Message, Field> descriptor,
                         Serializer serializer); @Nonnull static ArrayList<Message> arrayListFromResource(String path,
                                             PMessageDescriptor<Message, Field> descriptor,
                                             Serializer serializer); @Nonnull static String debugString(Message message); @Nonnull static Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor); @SuppressWarnings("unchecked") @Nonnull static Optional<T> optionalInMessage(PMessage message, PField... fields); }
ProvidenceHelper { @Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> String debugString(Message message) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DEBUG_STRING_SERIALIZER.serialize(baos, message); return new String(baos.toByteArray(), UTF_8); } private  ProvidenceHelper(); @SuppressWarnings("unchecked") static B getTargetModifications(M source, M target); @Nonnull static Message fromJsonResource(String path,
                             PMessageDescriptor<Message, Field> descriptor); @Nonnull static ArrayList<Message> arrayListFromJsonResource(String path,
                                                 PMessageDescriptor<Message, Field> descriptor); @Nonnull static Message fromResource(String resource,
                         PMessageDescriptor<Message, Field> descriptor,
                         Serializer serializer); @Nonnull static ArrayList<Message> arrayListFromResource(String path,
                                             PMessageDescriptor<Message, Field> descriptor,
                                             Serializer serializer); @Nonnull static String debugString(Message message); @Nonnull static Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor); @SuppressWarnings("unchecked") @Nonnull static Optional<T> optionalInMessage(PMessage message, PField... fields);  }