diff options
-rw-r--r-- | scripts/toy.groovy | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy index 6c54368..e85b83e 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -180,7 +180,7 @@ return new Object() { } public <T> T getProp(String i, java.util.function.Function<String, T> f, T d = null) { - final T v = f("toy.$i".toString()); + final T v = f.apply("toy.$i".toString()); if (v == null) return d; return v; } @@ -194,9 +194,9 @@ return new Object() { String dommeTitle() { getDommeProp("title", "Mistress") } String dommeName() { getDommeProp("name", "") } - boolean loadB(String p) { loadBoolean(p) } - int loadI(String p) { loadInteger(p) } - String loadS(String p ) { loadString(p) } + final java.util.function.Function<String, Boolean> loadB = this.&loadBoolean; + final java.util.function.Function<String, Integer> loadI = this.&loadInteger; + final java.util.function.Function<String, String> loadS = this.&loadString; void setProp(String i, Object v) { save("toy.$i".toString(), v) } boolean has(String i) { loadBoolean("toys.$i") == true } boolean likes(String i) { loadBoolean("fetish.$i") == true } |