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

Method getAsInt

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

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

()

Source from the content-addressed store, hash-verified

264 * @throws NumberFormatException if the value contained is not a valid integer.
265 */
266 @Override
267 public int getAsInt() {
268 return isNumber() ? getAsNumber().intValue() : Integer.parseInt(getAsString());
269 }
270
271 @Override
272 public byte getAsByte() {

Callers 2

testExponentialMethod · 0.95

Calls 3

isNumberMethod · 0.95
getAsNumberMethod · 0.95
getAsStringMethod · 0.95

Tested by 2

testExponentialMethod · 0.76