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

Method getAsFloat

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

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

()

Source from the content-addressed store, hash-verified

316 * @throws IllegalStateException if the array is empty or has more than one element.
317 */
318 @Override
319 public float getAsFloat() {
320 return getAsSingleElement().getAsFloat();
321 }
322
323 /**
324 * Convenience method to get this array as a long if it contains a single element. This method

Callers

nothing calls this directly

Calls 1

getAsSingleElementMethod · 0.95

Tested by

no test coverage detected