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

Method getAsLong

gson/src/main/java/com/google/gson/JsonArray.java:331–334  ·  view source on GitHub ↗

Convenience method to get this array as a long if it contains a single element. This method calls {@link JsonElement#getAsLong()} on the element, therefore any of the exceptions declared by that method can occur. @return this element as a long if it is single element array. @throws IllegalStateExce

()

Source from the content-addressed store, hash-verified

329 * @throws IllegalStateException if the array is empty or has more than one element.
330 */
331 @Override
332 public long getAsLong() {
333 return getAsSingleElement().getAsLong();
334 }
335
336 /**
337 * Convenience method to get this array as an integer if it contains a single element. This method

Callers 5

deserializeMethod · 0.45
deserializeMethod · 0.45
nextLongMethod · 0.45

Calls 1

getAsSingleElementMethod · 0.95

Tested by 4

deserializeMethod · 0.36
deserializeMethod · 0.36