@SuppressWarnings("unchecked")
    public <T> T deserialize(Object object, Type type) {
        if (object == null) {
            return null;
        }
        if (object.getClass().isEnum()) {
            return (T) object;
        }

        if (!(object instanceof String)) {
            throw new JSONException("enum object:[" + object + "] is invalid");
        }

        return (T) Enum.valueOf((Class<Enum>) enumType, object.toString());
    }
@author Robert HG (254963746@qq.com) on 12/30/15.
lts-core/src/main/java/com/github/ltsopensource/json/deserializer/EnumDeserializer.java