Interface Pointers
- All Superinterfaces:
Buildable<Pointers.Builder>
A collection of
pointers.- Since:
- 4.8.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Pointers.Builderbuilder()Gets a new pointers builder.static Pointersempty()Gets an empty pointers collection.<T> Optional<T> Gets the value ofpointer.default <T> @Nullable TgetOrDefault(Pointer<T> pointer, @Nullable T defaultValue) Gets the value ofpointer.default <T> @UnknownNullability TgetOrDefaultFrom(Pointer<T> pointer, Supplier<? extends T> defaultValue) Gets the value ofpointer.<T> booleanChecks if a given pointer is supported.
-
Method Details
-
empty
Gets an empty pointers collection.- Returns:
- the pointers
- Since:
- 4.8.0
-
builder
Gets a new pointers builder.- Returns:
- the builder
- Since:
- 4.8.0
- See Also:
-
get
-
getOrDefault
@Contract("_, null -> _; _, !null -> !null") default <T> @Nullable T getOrDefault(Pointer<T> pointer, @Nullable T defaultValue) Gets the value ofpointer.If a value for
pointeris unable to be provided,defaultValuewill be returned.- Type Parameters:
T- the type- Parameters:
pointer- the pointerdefaultValue- the default value- Returns:
- the value
- Since:
- 4.8.0
-
getOrDefaultFrom
default <T> @UnknownNullability T getOrDefaultFrom(Pointer<T> pointer, Supplier<? extends T> defaultValue) Gets the value ofpointer.If a value for
pointeris unable to be provided, the value supplied bydefaultValuewill be returned.- Type Parameters:
T- the type- Parameters:
pointer- the pointerdefaultValue- the default value supplier- Returns:
- the value
- Since:
- 4.8.0
-
supports
Checks if a given pointer is supported.This will return
truewhen a mapping for the provided pointer exists, even if the value for the pointer isnull.- Type Parameters:
T- the type- Parameters:
pointer- the pointer- Returns:
- if the pointer is supported
- Since:
- 4.8.0
-