Skip to content

Commit 9785b4f

Browse files
committed
enum support
1 parent ca30016 commit 9785b4f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

JSONArray.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public double getDouble(int index) throws JSONException {
254254
* The type of enum to retrieve.
255255
* @param index
256256
* The index must be between 0 and length() - 1.
257-
* @return The enum value.
257+
* @return The enum value at the index location
258258
* @throws JSONException
259259
* if the key is not found or if the value cannot be converted
260260
* to an enum.
@@ -563,7 +563,7 @@ public int optInt(int index, int defaultValue) {
563563
* The type of enum to retrieve.
564564
* @param index
565565
* The index must be between 0 and length() - 1.
566-
* @return The enum value or null if not found
566+
* @return The enum value at the index location or null if not found
567567
*/
568568
public <E extends Enum<E>> E optEnum(Class<E> clazz, int index) {
569569
return this.optEnum(clazz, index, null);
@@ -578,8 +578,8 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, int index) {
578578
* The index must be between 0 and length() - 1.
579579
* @param defaultValue
580580
* The default in case the value is not found
581-
* @return The enum value or defaultValue if the value is not found or
582-
* cannot be assigned to clazz
581+
* @return The enum value at the index location or defaultValue if
582+
* the value is not found or cannot be assigned to clazz
583583
*/
584584
public <E extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue) {
585585
try {

JSONObject.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ public Object get(String key) throws JSONException {
486486
* The type of enum to retrieve.
487487
* @param key
488488
* A key string.
489-
* @return The enum value.
489+
* @return The enum value associated with the key
490490
* @throws JSONException
491491
* if the key is not found or if the value cannot be converted
492492
* to an enum.
@@ -876,7 +876,7 @@ public Object opt(String key) {
876876
* The type of enum to retrieve.
877877
* @param key
878878
* A key string.
879-
* @return The enum value or null if not found
879+
* @return The enum value associated with the key or null if not found
880880
*/
881881
public <E extends Enum<E>> E optEnum(Class<E> clazz, String key) {
882882
return this.optEnum(clazz, key, null);
@@ -891,8 +891,8 @@ public <E extends Enum<E>> E optEnum(Class<E> clazz, String key) {
891891
* A key string.
892892
* @param defaultValue
893893
* The default in case the value is not found
894-
* @return The enum value or defaultValue if the value is not found or
895-
* cannot be assigned to clazz
894+
* @return The enum value associated with the key or defaultValue
895+
* if the value is not found or cannot be assigned to clazz
896896
*/
897897
public <E extends Enum<E>> E optEnum(Class<E> clazz, String key, E defaultValue) {
898898
try {

0 commit comments

Comments
 (0)