MCPcopy Index your code
hub / github.com/google/gson / getAsFloat

Method getAsFloat

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

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

()

Source from the content-addressed store, hash-verified

231 * @throws NumberFormatException if the value contained is not a valid float.
232 */
233 @Override
234 public float getAsFloat() {
235 return isNumber() ? getAsNumber().floatValue() : Float.parseFloat(getAsString());
236 }
237
238 /**
239 * convenience method to get this element as a primitive long.

Callers 1

Calls 3

isNumberMethod · 0.95
getAsNumberMethod · 0.95
getAsStringMethod · 0.95

Tested by 1