Convenience method to get this array as a {@link String} if it contains a single element. This method calls {@link JsonElement#getAsString()} on the element, therefore any of the exceptions declared by that method can occur. @return this element as a String if it is single element array. @throws Il
()
| 262 | * @throws IllegalStateException if the array is empty or has more than one element. |
| 263 | */ |
| 264 | @Override |
| 265 | public String getAsString() { |
| 266 | return getAsSingleElement().getAsString(); |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * Convenience method to get this array as a double if it contains a single element. This method |