code: public static long parseJsonValueToInteger(JsonValue value) {
          try {
              return value.asInt();
          } catch (UnsupportedOperationException e) {
              String s = value.asString().replace("\"", "");
              return Integer.parseInt(s);
          }
      }
docs: Parse a given JsonValue to an int regardless of whether that value is a String or an int.
  
  @param value a JsonValue to parse to an int.
  @return an int representation of the given value. Can throw a runtime exception (ParseException, UnsupportedOperationException, or NumberFormatException).