1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

enum support

This commit is contained in:
stleary 2015-07-22 20:16:02 -05:00
parent ca3001629a
commit 9785b4ff0b
2 changed files with 8 additions and 8 deletions

View file

@ -254,7 +254,7 @@ public class JSONArray implements Iterable<Object> {
* 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<Object> {
* 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 extends Enum<E>> E optEnum(Class<E> clazz, int index) {
return this.optEnum(clazz, index, null);
@ -578,8 +578,8 @@ public class JSONArray implements Iterable<Object> {
* 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 extends Enum<E>> E optEnum(Class<E> clazz, int index, E defaultValue) {
try {