diff options
author | isXander <xander@isxander.dev> | 2023-08-18 11:43:52 +0100 |
---|---|---|
committer | isXander <xander@isxander.dev> | 2023-08-18 11:43:52 +0100 |
commit | d7a9d31706a30c8b66dcd0587f6c82cf7c6118c9 (patch) | |
tree | 3464ddc568505ecd3095523bb7c8d2e70de00127 /common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java | |
parent | 39bc5b5d8b8e6d4369ea71a7787907521e11ad34 (diff) | |
download | YetAnotherConfigLib-d7a9d31706a30c8b66dcd0587f6c82cf7c6118c9.tar.gz YetAnotherConfigLib-d7a9d31706a30c8b66dcd0587f6c82cf7c6118c9.tar.bz2 YetAnotherConfigLib-d7a9d31706a30c8b66dcd0587f6c82cf7c6118c9.zip |
Enforce NotNull on bindings
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java')
-rw-r--r-- | common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java | 6 |
1 files changed, 4 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 165f38d..37a626b 100644 --- a/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java +++ b/common/src/main/java/dev/isxander/yacl3/impl/OptionImpl.java @@ -41,7 +41,7 @@ public final class OptionImpl<T> implements Option<T> { @NotNull Collection<BiConsumer<Option<T>, T>> listeners ) { this.name = name; - this.binding = binding; + this.binding = new SafeBinding<>(binding); this.available = available; this.flags = flags; this.listeners = new ArrayList<>(listeners); @@ -108,7 +108,9 @@ public final class OptionImpl<T> implements Option<T> { } @Override - public void requestSet(T value) { + public void requestSet(@NotNull T value) { + Validate.notNull(value, "`value` cannot be null"); + pendingValue = value; this.triggerListeners(true); } |