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

Method getAsShort

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

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

()

Source from the content-addressed store, hash-verified

253 * @throws NumberFormatException if the value contained is not a valid short value.
254 */
255 @Override
256 public short getAsShort() {
257 return isNumber() ? getAsNumber().shortValue() : Short.parseShort(getAsString());
258 }
259
260 /**
261 * convenience method to get this element as a primitive integer.

Callers 1

Calls 3

isNumberMethod · 0.95
getAsNumberMethod · 0.95
getAsStringMethod · 0.95

Tested by 1