diff options
author | isxander <xander@isxander.dev> | 2023-11-18 09:43:58 +0000 |
---|---|---|
committer | isxander <xander@isxander.dev> | 2023-11-18 09:43:58 +0000 |
commit | 4cdfa58b27d790786cbb2f17aa8f4635ea9d5a2d (patch) | |
tree | c29d86d94fd08cfabea052ab52e2e87ee7d3f030 /common/src/main | |
parent | 442f48a6e28196910e92f460d3d677e3e47cbfc0 (diff) | |
download | YetAnotherConfigLib-4cdfa58b27d790786cbb2f17aa8f4635ea9d5a2d.tar.gz YetAnotherConfigLib-4cdfa58b27d790786cbb2f17aa8f4635ea9d5a2d.tar.bz2 YetAnotherConfigLib-4cdfa58b27d790786cbb2f17aa8f4635ea9d5a2d.zip |
Set the pending value before creating the controller
Diffstat (limited to 'common/src/main')
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java index 37a626b..e539f73 100644 --- a/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java +++ b/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java @@ -45,11 +45,12 @@ public final class OptionImpl<T> implements Option<T> { this.available = available; this.flags = flags; this.listeners = new ArrayList<>(listeners); + + this.pendingValue = binding.getValue(); this.controller = controlGetter.apply(this); addListener((opt, pending) -> description = descriptionFunction.apply(pending)); - - requestSet(binding().getValue()); + triggerListeners(true); } @Override |