Hi,

I'm thinking about improving tapestry-json but wanted to ask first if
there's actually some interest in doing so, before starting to code and
making a pull-request.

We have multiple utility classes for simpler JSON usage:

JSONArray:
- static JSONArray safeNew(String jsonStr)
- JSONArray from(Iterable<?> iterable)
- JSONArray from(Iterable<?> iterable, boolean preserveNull)
- boolean putUnique(Object obj)
- multiple typed toList(...) which might be refactored into a single
generic method

JSONObject:
- static JSONObject safeNew(String jsonStr)
- <K, V> Map<K, V> toMap(Function<String, K> keyFn, Function<Object, V>
valueFn)
- static JSONObject from(Map<String, Object> map)

JSONCollectors:
- static <T> Collector<T, JSONArray, JSONArray> toArray()
- a collector to JSONObject wasn't needed so far

Other functionality I would like to add:
- Stream-Support for JSONArray
- Safe getters, e.g., Optional<String> JSONArray#tryGet(String key),
although I haven't thought much about correct null vs NULL-sentinel
handling.

What do you think? Worth the effort, or really on utility classes?

Ben

Reply via email to