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

Method getAsDouble

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

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

()

Source from the content-addressed store, hash-verified

275 * @throws IllegalStateException if the array is empty or has more than one element.
276 */
277 @Override
278 public double getAsDouble() {
279 return getAsSingleElement().getAsDouble();
280 }
281
282 /**
283 * Convenience method to get this array as a {@link BigDecimal} if it contains a single element.

Callers 2

nextDoubleMethod · 0.45

Calls 1

getAsSingleElementMethod · 0.95

Tested by 1