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)
| 538 | * @throws RuntimeException if the key is not found. |
| 539 | */ |
| 540 | public Object get(String key) { |
| 541 | if (key == null) { |
| 542 | throw new RuntimeException("JSONObject.get(null) called"); |
| 543 | } |
| 544 | Object object = this.opt(key); |
| 545 | if (object == null) { |
| 546 | // Adding for rev 0257 in line with other p5 api |
| 547 | return null; |
| 548 | } |
| 549 | if (object == null) { |
| 550 | throw new RuntimeException("JSONObject[" + quote(key) + "] not found"); |
| 551 | } |
| 552 | return object; |
| 553 | } |
| 554 | |
| 555 | |
| 556 | /** |
no test coverage detected