public static final <T> T toObject(JSONObject json, Class clazz, Map<String, Object> references) {
if (clazz == null) {
throw new RuntimeException("the decode class can't be null.");
}
JSONDecoder decoder = JSONDecoder.get(clazz);
Object obj = decoder.decode(json, references);
return (T) obj;
}