diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-11 14:59:18 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-11 14:59:18 +0100 |
commit | d4f99e11f00c0b82d84a0f4432d8a0eaa8adca34 (patch) | |
tree | 5bfc2cecedc4110b68a873073b7c1d4d074954d2 /node-admin | |
parent | b75fc51e5d0f6f43dad8e999273e1754545a647f (diff) |
Improve documentation
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Form.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Form.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Form.java index 0148a976251..6b38835e24f 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Form.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Form.java @@ -30,13 +30,15 @@ public class Form { void setParent(Form parent) { this.parent = parent; } - /** Set the value of a variable expression, e.g. %{=color}. */ + /** Set the value of a variable, e.g. %{=color}. */ public Form set(String name, String value) { values.put(name, value); return this; } + /** Set the value of a variable and/or if-condition. */ public Form set(String name, boolean value) { return set(name, Boolean.toString(value)); } + public Form set(String name, int value) { return set(name, Integer.toString(value)); } public Form set(String name, long value) { return set(name, Long.toString(value)); } @@ -78,9 +80,7 @@ public class Form { Optional<String> getVariableValue(String name) { String value = values.get(name); if (value != null) return Optional.of(value); - if (parent != null) { - return parent.getVariableValue(name); - } + if (parent != null) return parent.getVariableValue(name); return Optional.empty(); } } |