MCPcopy
hub / github.com/google/gson / getAsLong

Method getAsLong

src/main/java/com/google/gson/JsonPrimitive.java:244–247  ·  view source on GitHub ↗

convenience method to get this element as a primitive long. @return get this element as a primitive long. @throws NumberFormatException if the value contained is not a valid long.

()

Source from the content-addressed store, hash-verified

242 * @throws NumberFormatException if the value contained is not a valid long.
243 */
244 @Override
245 public long getAsLong() {
246 return isNumber() ? getAsNumber().longValue() : Long.parseLong(getAsString());
247 }
248
249 /**
250 * convenience method to get this element as a primitive short.

Callers 1

Calls 3

isNumberMethod · 0.95
getAsNumberMethod · 0.95
getAsStringMethod · 0.95

Tested by 1