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

Method getAsShort

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

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

()

Source from the content-addressed store, hash-verified

384 * @throws IllegalStateException if the array is empty or has more than one element.
385 */
386 @Override
387 public short getAsShort() {
388 return getAsSingleElement().getAsShort();
389 }
390
391 /**
392 * Convenience method to get this array as a boolean if it contains a single element. This method

Callers

nothing calls this directly

Calls 1

getAsSingleElementMethod · 0.95

Tested by

no test coverage detected