1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package dev.isxander.yacl.api; import dev.isxander.yacl.impl.GenericBindingImpl; import java.util.function.Consumer; import java.util.function.Supplier; public interface Binding<T> { void setValue(T value); T getValue(); T defaultValue(); static <T> Binding<T> of(T def, Supplier<T> getter, Consumer<T> setter) { return new GenericBindingImpl<>(def, getter, setter); } }