MCPcopy Index your code
hub / github.com/processing/processing / getBoolean

Method getBoolean

core/src/processing/data/JSONObject.java:752–764  ·  view source on GitHub ↗

Get the boolean value associated with a key. @webref jsonobject:method @brief Gets the boolean value associated with a key @param key a key string @return The truth. @throws RuntimeException if the value is not a Boolean or the String "true" or "false". @see JSONObject#getInt(String) @see JSONObjec

(String key)

Source from the content-addressed store, hash-verified

750 * @see JSONObject#getString(String)
751 */
752 public boolean getBoolean(String key) {
753 Object object = this.get(key);
754 if (object.equals(Boolean.FALSE) ||
755 (object instanceof String &&
756 ((String)object).equalsIgnoreCase("false"))) {
757 return false;
758 } else if (object.equals(Boolean.TRUE) ||
759 (object instanceof String &&
760 ((String)object).equalsIgnoreCase("true"))) {
761 return true;
762 }
763 throw new RuntimeException("JSONObject[" + quote(key) + "] is not a Boolean.");
764 }
765
766
767 /**

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
quoteMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected