@Test public void testJSONParse() { String json = JSON.stringify(new Person("abc", 123)); System.out.println(json); Person p = Parse.data(json, Person.class); eq(p.getName(), "abc"); eq(p.getAge(), 123); isNull(Parse.data("null", Person.class)); eq(Parse.data("3", Integer.class).intValue(), 3); isTrue(Parse.data("true", Boolean.class).booleanValue()); isFalse(Parse.data("false", Boolean.class).booleanValue()); eq(Parse.data("\"123\"", String.class), "123"); }
public static <T> T data(String data, Class<T> targetType) { return data(data.getBytes(), targetType); }
Parse extends RapidoidThing { public static <T> T data(String data, Class<T> targetType) { return data(data.getBytes(), targetType); } }
Parse extends RapidoidThing { public static <T> T data(String data, Class<T> targetType) { return data(data.getBytes(), targetType); }  }
Parse extends RapidoidThing { public static <T> T data(String data, Class<T> targetType) { return data(data.getBytes(), targetType); }  static T data(String data, Class<T> targetType); @SuppressWarnings("unchecked") static T data(byte[] data, Class<T> targetType); }
Parse extends RapidoidThing { public static <T> T data(String data, Class<T> targetType) { return data(data.getBytes(), targetType); }  static T data(String data, Class<T> targetType); @SuppressWarnings("unchecked") static T data(byte[] data, Class<T> targetType);  }