From 14479cbf39c8bb88e06e969c86d08e4945eb1513 Mon Sep 17 00:00:00 2001 From: samuelhsin Date: Sun, 31 Aug 2014 15:22:57 +0800 Subject: [PATCH] Add Enum Type Support Add enum type support when object was wrapped --- JSONObject.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/JSONObject.java b/JSONObject.java index d66623110..ab7ffa231 100755 --- a/JSONObject.java +++ b/JSONObject.java @@ -1550,6 +1550,10 @@ public static Object wrap(Object object) { return object; } + if(object instanceof Enum) { + return object.toString(); + } + if (object instanceof Collection) { return new JSONArray((Collection) object); }