MCPcopy Create free account
hub / github.com/MCBans/MCBans / getLong

Method getLong

src/main/java/com/mcbans/plugin/org/json/JSONObject.java:569–579  ·  view source on GitHub ↗

Get the long value associated with a key. @param key A key string. @return The long value. @throws JSONException if the key is not found or if the value cannot be converted to a long.

(String key)

Source from the content-addressed store, hash-verified

567 * be converted to a long.
568 */
569 public long getLong(String key) throws JSONException {
570 Object object = get(key);
571 try {
572 return object instanceof Number ?
573 ((Number)object).longValue() :
574 Long.parseLong((String)object);
575 } catch (Exception e) {
576 throw new JSONException("JSONObject[" + quote(key) +
577 "] is not a long.");
578 }
579 }
580
581
582 /**

Callers 1

optLongMethod · 0.95

Calls 2

getMethod · 0.95
quoteMethod · 0.95

Tested by

no test coverage detected