From 9785b4ff0b2d920ea81aa1303f79d5bfb1485135 Mon Sep 17 00:00:00 2001 From: stleary Date: Wed, 22 Jul 2015 20:16:02 -0500 Subject: [PATCH] enum support --- JSONArray.java | 8 ++++---- JSONObject.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/JSONArray.java b/JSONArray.java index 5806917..3aaa185 100644 --- a/JSONArray.java +++ b/JSONArray.java @@ -254,7 +254,7 @@ public class JSONArray implements Iterable { * The type of enum to retrieve. * @param index * The index must be between 0 and length() - 1. - * @return The enum value. + * @return The enum value at the index location * @throws JSONException * if the key is not found or if the value cannot be converted * to an enum. @@ -563,7 +563,7 @@ public class JSONArray implements Iterable { * The type of enum to retrieve. * @param index * The index must be between 0 and length() - 1. - * @return The enum value or null if not found + * @return The enum value at the index location or null if not found */ public > E optEnum(Class clazz, int index) { return this.optEnum(clazz, index, null); @@ -578,8 +578,8 @@ public class JSONArray implements Iterable { * The index must be between 0 and length() - 1. * @param defaultValue * The default in case the value is not found - * @return The enum value or defaultValue if the value is not found or - * cannot be assigned to clazz + * @return The enum value at the index location or defaultValue if + * the value is not found or cannot be assigned to clazz */ public > E optEnum(Class clazz, int index, E defaultValue) { try { diff --git a/JSONObject.java b/JSONObject.java index 2bf733b..fc7fb81 100755 --- a/JSONObject.java +++ b/JSONObject.java @@ -486,7 +486,7 @@ public class JSONObject { * The type of enum to retrieve. * @param key * A key string. - * @return The enum value. + * @return The enum value associated with the key * @throws JSONException * if the key is not found or if the value cannot be converted * to an enum. @@ -876,7 +876,7 @@ public class JSONObject { * The type of enum to retrieve. * @param key * A key string. - * @return The enum value or null if not found + * @return The enum value associated with the key or null if not found */ public > E optEnum(Class clazz, String key) { return this.optEnum(clazz, key, null); @@ -891,8 +891,8 @@ public class JSONObject { * A key string. * @param defaultValue * The default in case the value is not found - * @return The enum value or defaultValue if the value is not found or - * cannot be assigned to clazz + * @return The enum value associated with the key or defaultValue + * if the value is not found or cannot be assigned to clazz */ public > E optEnum(Class clazz, String key, E defaultValue) { try {