Convenience method to get this array as a double if it contains a single element. This method calls {@link JsonElement#getAsDouble()} on the element, therefore any of the exceptions declared by that method can occur. @return this element as a double if it is single element array. @throws IllegalSta
()
| 275 | * @throws IllegalStateException if the array is empty or has more than one element. |
| 276 | */ |
| 277 | @Override |
| 278 | public double getAsDouble() { |
| 279 | return getAsSingleElement().getAsDouble(); |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Convenience method to get this array as a {@link BigDecimal} if it contains a single element. |