Returns the value at index if it exists and is an int or can be coerced to an int. @param index Which value to get. @return the value at the specified location. @throws JSONException if the value at index doesn't exist or cannot be coerced to a int.
(int index)
| 444 | * cannot be coerced to a int. |
| 445 | */ |
| 446 | public int getInt(int index) throws JSONException { |
| 447 | Object object = get(index); |
| 448 | Integer result = JSON.toInteger(object); |
| 449 | if (result == null) { |
| 450 | throw JSON.typeMismatch(index, object, "int"); |
| 451 | } |
| 452 | return result; |
| 453 | } |
| 454 | |
| 455 | /** |
| 456 | * Returns the value at {@code index} if it exists and is an int or |
no test coverage detected