code: public static <P extends Enum<P>> boolean hasEnum(final JSONObject json,
                                                        final String key, final Class<? extends Enum> enumType) {
          if (hasInstanceOf(json, key, enumType)) {
              return true;
          }
  
          final Object o = json.opt(key);
          if (o == null || o == JSONObject.NULL) {
              return false;
          }
  
          if (o instanceof String) {
              final String s = (String) o;
              try {
                  Enum.valueOf(enumType, s);
                  return true;
              } catch (IllegalArgumentException e) {
                  Log.e(Log.SUBSYSTEM.JSON, TAG, e,
                          "hasEnum(): failed to coerce value at '%s' to %s (%s)",
                          key, enumType.getSimpleName(), o);
              }
          }
          return false;
      }
docs: Check if the specified {@link JSONObject} has an {@link Enum} at {@code key}.
  <p>
  If the item is not naturally an {@code Enum}, checks to see if it is a {@link String} with
  one of the {@code Enum's} {@linkplain Enum#valueOf(Class, String) values}.
  
  @param json {@code JSONObject} to inspect
  @param key  Item in object to check
  @return {@code True} if the item exists and is an {@code Enum};
  {@code false} otherwise