Custom Text Faceting works as it always has. (might need to be bang tested by you to make sure I did not assume too much)
This facet looks correct as it did before my changes.
static public boolean isStorable(Object v) {
return v == null ||
v instanceof Number ||
v instanceof String ||
v instanceof Boolean ||
v instanceof Date ||
v instanceof Calendar ||
v instanceof EvalError ||
v instanceof Arrays || // NEW
v instanceof Collection || // NEW
v instanceof List; // NEW
}
static public Serializable wrapStorable(Object v) {
if (v instanceof JSONArray) {
return ((JSONArray) v).toString();
} else if (v instanceof JSONObject) {
return ((JSONObject) v).toString();
// NEW
} else if (v instanceof List) {
return ((List<?>) v).toString();
} else if (v.getClass().isArray()) {
} else if (v instanceof Collection<?>) {
return ((Collection<?>) v).toArray().toString();
// NEW
} else {
return isStorable(v) ?
(Serializable) v :
new EvalError(v.getClass().getSimpleName() + " value not storable");
}
}