T
- The type of the property.public interface Property<T>
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the current value of the property.
|
default <U> Property<U> |
map(java.util.function.Function<? super T,? extends U> out,
java.util.function.Function<? super U,? extends T> in) |
static <T> Property<T> |
over(java.util.function.Supplier<T> get,
java.util.function.Consumer<T> set)
Create a property which defers its implementation to the given callbacks.
|
T |
set(T to)
Set the value of this property to the given value.
|
default Property<T> |
setDefault(java.util.function.Supplier<T> defaultValue) |
default java.util.Optional<T> |
tryGet() |
default T |
unset()
Set the value of this property to null.
|
T set(T to)
to
- The new value to set for this property.default T unset()
NullPointerException
if null values are not supported by the
underlying implementation.T get()
default java.util.Optional<T> tryGet()
default <U> Property<U> map(java.util.function.Function<? super T,? extends U> out, java.util.function.Function<? super U,? extends T> in)
static <T> Property<T> over(java.util.function.Supplier<T> get, java.util.function.Consumer<T> set)
get
- the property retrieval callbackset
- the property assignment callback