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

Method getAsBoolean

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

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

()

Source from the content-addressed store, hash-verified

397 * @throws IllegalStateException if the array is empty or has more than one element.
398 */
399 @Override
400 public boolean getAsBoolean() {
401 return getAsSingleElement().getAsBoolean();
402 }
403
404 /**
405 * Returns a mutable {@link List} view of this {@code JsonArray}. Changes to the {@code List} are

Callers 3

nextBooleanMethod · 0.45

Calls 1

getAsSingleElementMethod · 0.95