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