MCPcopy Create free account
hub / github.com/akeranen/the-one / getBoolean

Method getBoolean

core/Settings.java:696–714  ·  view source on GitHub ↗

Returns a boolean-valued setting @param name Name of the setting to get @return True if the settings value was either "true" (case ignored) or "1", false is the settings value was either "false" (case ignored) or "0". @throws SettingsError if the value wasn't any recognized value @see #getSettin

(String name)

Source from the content-addressed store, hash-verified

694 * @see #getSetting(String)
695 */
696 public boolean getBoolean(String name) {
697 String stringValue = getSetting(name);
698 boolean value;
699
700 if (stringValue.equalsIgnoreCase("true") ||
701 stringValue.equals("1")) {
702 value = true;
703 }
704 else if (stringValue.equalsIgnoreCase("false") ||
705 stringValue.equals("0")) {
706 value = false;
707 }
708 else {
709 throw new SettingsError("Not a boolean value: '"+stringValue+
710 "' for setting " + name);
711 }
712
713 return value;
714 }
715
716 /**
717 * Returns the given boolean setting if it exists, or defaultValue if the

Callers 7

initSettingsMethod · 0.95
SimScenarioMethod · 0.95
createCheckItemMethod · 0.95
SprayAndWaitRouterMethod · 0.95
PingApplicationMethod · 0.80
testGetBooleanMethod · 0.80
ActiveRouterMethod · 0.80

Calls 3

getSettingMethod · 0.95
containsMethod · 0.95
equalsMethod · 0.45

Tested by 1

testGetBooleanMethod · 0.64