MCPcopy Create free account
hub / github.com/apache/groovy / isSet

Method isSet

src/main/java/groovy/util/ConfigObject.java:436–444  ·  view source on GitHub ↗

Checks if a config option is set. Example usage: def config = new ConfigSlurper().parse("foo { password='' }") assert config.foo.isSet('password') assert config.foo.isSet('username') == false The check works only for options one bloc

(String option)

Source from the content-addressed store, hash-verified

434 * @since 2.3.0
435 */
436 public Boolean isSet(String option) {
437 if (delegateMap.containsKey(option)) {
438 Object entry = delegateMap.get(option);
439 if (!(entry instanceof ConfigObject) || !((ConfigObject) entry).isEmpty()) {
440 return Boolean.TRUE;
441 }
442 }
443 return Boolean.FALSE;
444 }
445
446 /**
447 * Renders this config object using config-script syntax.

Callers 12

catMethod · 0.80
wcMethod · 0.80
headMethod · 0.80
tailMethod · 0.80
lsMethod · 0.80
compareToMethod · 0.80
doCompareMethod · 0.80
displayMethod · 0.80
formatSizeMethod · 0.80
readAttributesMethod · 0.80
grepMethod · 0.80
sortMethod · 0.80

Calls 3

containsKeyMethod · 0.65
getMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected