@Test public void jsonBeansToArray() { assertThat(JsonUtils.jsonBeansToArray(Collections.emptyList())).isEqualTo("[]"); assertThat(JsonUtils.jsonBeansToArray(Collections.singletonList("{\"foo\": \"bar\"}"))).isEqualTo("[{\"foo\": \"bar\"}]"); assertThat(JsonUtils.jsonBeansToArray(Arrays.asList("{\"foo1\": \"bar1\"}", "{\"foo2\": \"bar2\"}"))).isEqualTo("[{\"foo1\": \"bar1\"},{\"foo2\": \"bar2\"}]"); }
public static String jsonBeansToArray(List<?> jsonBeans) { final StringJoiner joiner = new StringJoiner(",", "[", "]"); for (Object jsonBean : jsonBeans) { joiner.add(String.valueOf(jsonBean)); } return joiner.toString(); }
JsonUtils { public static String jsonBeansToArray(List<?> jsonBeans) { final StringJoiner joiner = new StringJoiner(",", "[", "]"); for (Object jsonBean : jsonBeans) { joiner.add(String.valueOf(jsonBean)); } return joiner.toString(); } }
JsonUtils { public static String jsonBeansToArray(List<?> jsonBeans) { final StringJoiner joiner = new StringJoiner(",", "[", "]"); for (Object jsonBean : jsonBeans) { joiner.add(String.valueOf(jsonBean)); } return joiner.toString(); } private  JsonUtils(); }
JsonUtils { public static String jsonBeansToArray(List<?> jsonBeans) { final StringJoiner joiner = new StringJoiner(",", "[", "]"); for (Object jsonBean : jsonBeans) { joiner.add(String.valueOf(jsonBean)); } return joiner.toString(); } private  JsonUtils(); static ObjectReader reader(); static T readFromStream(final InputStream stream, final Class<T> type); static ObjectWriter writer(); static ObjectMapper copyObjectMapperConfiguration(); static Map<String, Object> map(Object... values); static T convertValue(final Object fromValue, final Class<T> toValueType); static boolean isJson(String value); static boolean isJsonObject(String value); static boolean isJsonArray(String value); static List<String> arrayToJsonBeans(JsonNode json); static String jsonBeansToArray(List<?> jsonBeans); static String toPrettyString(Object value); static String toString(Object value); }
JsonUtils { public static String jsonBeansToArray(List<?> jsonBeans) { final StringJoiner joiner = new StringJoiner(",", "[", "]"); for (Object jsonBean : jsonBeans) { joiner.add(String.valueOf(jsonBean)); } return joiner.toString(); } private  JsonUtils(); static ObjectReader reader(); static T readFromStream(final InputStream stream, final Class<T> type); static ObjectWriter writer(); static ObjectMapper copyObjectMapperConfiguration(); static Map<String, Object> map(Object... values); static T convertValue(final Object fromValue, final Class<T> toValueType); static boolean isJson(String value); static boolean isJsonObject(String value); static boolean isJsonArray(String value); static List<String> arrayToJsonBeans(JsonNode json); static String jsonBeansToArray(List<?> jsonBeans); static String toPrettyString(Object value); static String toString(Object value);  }