@Test public void testConvertJsonArray() { int intValue = Random.getInt(); String string = Random.getString(); boolean bool = Random.getBoolean(); long longVal = Random.getLong(); float floatVal = Random.getFloat(); double doubleVal = Random.getDouble(); Set<Object> expected = Sets.<Object> newHashSet(intValue, string, bool, longVal, floatVal, doubleVal); String json = "{\"array\": [" + intValue + ", \"" + string + "\", " + bool + ", " + longVal + ", " + floatVal + ", \"" + doubleVal + "D\"]}"; Multimap<String, Object> data = Convert.jsonToJava(json); Set<Object> values = Sets.newHashSet(data.get("array")); Set<Object> oddMenOut = Sets.symmetricDifference(expected, values); Assert.assertEquals(0, oddMenOut.size()); }
public static Multimap<String, Object> jsonToJava(String json) { try (JsonReader reader = new JsonReader(new StringReader(json))) { reader.setLenient(true); return jsonToJava(reader); } catch (IOException e) { throw CheckedExceptions.wrapAsRuntimeException(e); } }
Convert { public static Multimap<String, Object> jsonToJava(String json) { try (JsonReader reader = new JsonReader(new StringReader(json))) { reader.setLenient(true); return jsonToJava(reader); } catch (IOException e) { throw CheckedExceptions.wrapAsRuntimeException(e); } } }
Convert { public static Multimap<String, Object> jsonToJava(String json) { try (JsonReader reader = new JsonReader(new StringReader(json))) { reader.setLenient(true); return jsonToJava(reader); } catch (IOException e) { throw CheckedExceptions.wrapAsRuntimeException(e); } } private  Convert(); }
Convert { public static Multimap<String, Object> jsonToJava(String json) { try (JsonReader reader = new JsonReader(new StringReader(json))) { reader.setLenient(true); return jsonToJava(reader); } catch (IOException e) { throw CheckedExceptions.wrapAsRuntimeException(e); } } private  Convert(); static List<Multimap<String, Object>> anyJsonToJava(String json); static TObject javaToThrift(Object object); static Multimap<String, Object> jsonToJava(String json); @SuppressWarnings("unchecked") static String mapsToJson(Collection<Multimap<String, Object>> list); static String mapToJson(Map<String, ?> map); static String mapToJson(Multimap<String, Object> map); static String operatorToString(Operator operator); @SuppressWarnings("unchecked") static T possibleThriftToJava(Object tobject); static Object stringToJava(String value); static Operator stringToOperator(String symbol); static String stringToResolvableLinkInstruction(String ccl); @Deprecated static String stringToResolvableLinkSpecification(String key,
            String rawValue); static Object thriftToJava(TObject object); static Object toFunctionOrUnescapedValueIfPossible(Object value); }
Convert { public static Multimap<String, Object> jsonToJava(String json) { try (JsonReader reader = new JsonReader(new StringReader(json))) { reader.setLenient(true); return jsonToJava(reader); } catch (IOException e) { throw CheckedExceptions.wrapAsRuntimeException(e); } } private  Convert(); static List<Multimap<String, Object>> anyJsonToJava(String json); static TObject javaToThrift(Object object); static Multimap<String, Object> jsonToJava(String json); @SuppressWarnings("unchecked") static String mapsToJson(Collection<Multimap<String, Object>> list); static String mapToJson(Map<String, ?> map); static String mapToJson(Multimap<String, Object> map); static String operatorToString(Operator operator); @SuppressWarnings("unchecked") static T possibleThriftToJava(Object tobject); static Object stringToJava(String value); static Operator stringToOperator(String symbol); static String stringToResolvableLinkInstruction(String ccl); @Deprecated static String stringToResolvableLinkSpecification(String key,
            String rawValue); static Object thriftToJava(TObject object); static Object toFunctionOrUnescapedValueIfPossible(Object value);  }