MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / getString

Method getString

src/main/java/field/utility/Options.java:133–143  ·  view source on GitHub ↗
(String key, Supplier<String> def)

Source from the content-addressed store, hash-verified

131
132
133 public static String getString(String key, Supplier<String> def) {
134 Dict.Prop pp = new Dict.Prop(key);
135 boolean found = dict().has(pp);
136
137 Object out = dict().computeIfAbsent(pp, (k) -> def.get());
138 String r = out == null ? null : ("" + out);
139
140 System.err.println("-" + key + " = " + r + (found ? "" : "(default)"));
141
142 return r;
143 }
144
145 public static String getDirectory(String key, Supplier<String> def) {
146 String v = getString(key, def);

Callers 15

mainMethod · 0.95
mainMethod · 0.95
runMethod · 0.95
getDirectoryMethod · 0.95
StartupClass · 0.80
loadedMethod · 0.80
RemoteEditorMethod · 0.80
onMessageMethod · 0.80
onMessageMethod · 0.80
parseMethod · 0.80
parseMetaMapMethod · 0.80
getJavaStringArrayMethod · 0.80

Calls 5

dictMethod · 0.95
computeIfAbsentMethod · 0.80
getMethod · 0.65
hasMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected