Get the value object associated with a key. @param key A key string. @return The object associated with the key. @throws RuntimeException if the key is not found.
(String key)
| 551 | * @throws RuntimeException if the key is not found. |
| 552 | */ |
| 553 | public Object get(String key) { |
| 554 | if (key == null) { |
| 555 | throw new RuntimeException("JSONObject.get(null) called"); |
| 556 | } |
| 557 | Object object = this.opt(key); |
| 558 | if (object == null) { |
| 559 | // Adding for rev 0257 in line with other p5 api |
| 560 | return null; |
| 561 | } |
| 562 | if (object == null) { |
| 563 | throw new RuntimeException("JSONObject[" + quote(key) + "] not found"); |
| 564 | } |
| 565 | return object; |
| 566 | } |
| 567 | |
| 568 | |
| 569 | /** |
no test coverage detected