aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/api
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-01 20:23:00 +0100
committerxander <xander@isxander.dev>2022-09-01 20:23:00 +0100
commitf46fc1e9d85d555cd557eefa10e1211f9ad1ceb1 (patch)
tree123fa86dcf4f27a63f0398ca4726e5876f5d04a2 /src/main/java/dev/isxander/yacl/api
parent627c45bd6cfa7cce9e048d7681029c812a45f1cc (diff)
downloadYetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.tar.gz
YetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.tar.bz2
YetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.zip
CI stuff
rename binding functions and format numbers with commas
Diffstat (limited to 'src/main/java/dev/isxander/yacl/api')
-rw-r--r--src/main/java/dev/isxander/yacl/api/Binding.java4
-rw-r--r--src/main/java/dev/isxander/yacl/api/Option.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/dev/isxander/yacl/api/Binding.java b/src/main/java/dev/isxander/yacl/api/Binding.java
index d870d8c..37514ca 100644
--- a/src/main/java/dev/isxander/yacl/api/Binding.java
+++ b/src/main/java/dev/isxander/yacl/api/Binding.java
@@ -26,7 +26,7 @@ public interface Binding<T> {
* @param getter should return the current value of the option
* @param setter should set the option to the supplied value
*/
- static <T> Binding<T> of(T def, Supplier<T> getter, Consumer<T> setter) {
+ static <T> Binding<T> generic(T def, Supplier<T> getter, Consumer<T> setter) {
Validate.notNull(def, "`def` must not be null");
Validate.notNull(getter, "`getter` must not be null");
Validate.notNull(setter, "`setter` must not be null");
@@ -37,7 +37,7 @@ public interface Binding<T> {
/**
* Creates a {@link Binding} for Minecraft's {@link SimpleOption}
*/
- static <T> Binding<T> of(SimpleOption<T> minecraftOption) {
+ static <T> Binding<T> minecraft(SimpleOption<T> minecraftOption) {
Validate.notNull(minecraftOption, "`minecraftOption` must not be null");
return new GenericBindingImpl<>(
diff --git a/src/main/java/dev/isxander/yacl/api/Option.java b/src/main/java/dev/isxander/yacl/api/Option.java
index 6598b80..65eae23 100644
--- a/src/main/java/dev/isxander/yacl/api/Option.java
+++ b/src/main/java/dev/isxander/yacl/api/Option.java
@@ -147,7 +147,7 @@ public interface Option<T> {
/**
* Sets the binding for the option.
- * Shorthand of {@link Binding#of(Object, Supplier, Consumer)}
+ * Shorthand of {@link Binding#generic(Object, Supplier, Consumer)}
*
* @param def default value of the option, used to reset
* @param getter should return the current value of the option
@@ -159,7 +159,7 @@ public interface Option<T> {
Validate.notNull(getter, "`getter` must not be null");
Validate.notNull(setter, "`setter` must not be null");
- this.binding = Binding.of(def, getter, setter);
+ this.binding = Binding.generic(def, getter, setter);
return this;
}